프로그램 명: coci_kutevi
제한시간: 1 초

[문제요약] 각도를 줄 때 이를 더하거나 빼서 주어지는 각도를 만들 수 있는 가를 알아내는 문제이다.

예를 들어 30 , 70 도 주어질 때 70 - 30 = 40 도를 만들 수 있어 첫번째 예는 YES , 100 도가 주어질 때 60 도를 만들 수 있는 있는가는 100 을 15 번 더하면 1500 도...1500 도는 60 도가 되어 YES

입출력 형식

3 2 // 주어지는각도수 , 질의각도수
10 20 30 //주어지는 각도들 
5 70 //질의각도들 

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.

입력

출력

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.

입출력 예

input

2 1
30 70
40

output

YES

input

1 1
100
60

output

YES

input

3 2
10 20 30
5 70

output

NO
YES

exmaples

First example description: Subtracting 30° from 70° yields 70° - 30° = 40°.

Second example description: Adding 100° 15 times yields 1500°, also known as 60°.

출처:COCI 2009/2010 contest2 3/6

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]