#953
Gold V
KUTEVI
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Author: Bruno Rahle One day Mirko was cleaning up his room and found a straightedge and a compass. He went to the school the next day and challenged his friend Slavko to a geometric construction battle. Mirko knows how to construct some angles using the straightedge and compass and knows how to subtract and add any two angels he constructs. Slavko now shouts random angles and Mirko must draw them as fast as possible. You are observing this battle and would like to know if Mirko can construct the angles Slavko shouts at all.

입력

The first line of input contains two integers, N (1 ≤ N ≤ 10), number of angles Mirko knows how to construct initially and K (1 ≤ K ≤ 10), number of angles Slavko selected. The second line of input contains N integers, all smaller than 360, the angles Mirko knows how to construct initially. The third line contains K integers, all smaller than 360, the angles Slavko selected.

출력

Output consist of K lines, one for each angle Slavko selected. The i-th line should contain "YES" if Mirko can construct the i-th angle, and "NO" otherwise.

예제 입력 1

2 1
30 70
40

예제 출력 1

YES

예제 입력 2

1 1
100
60

예제 출력 2

YES

예제 입력 3

3 2
10 20 30
5 70

예제 출력 3

NO
YES
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Gold V1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.