Changyeong found a ruler and a protractor while cleaning his room. The next day, he brought them to school to have a construction contest with Hyunwoo.
Changyeong knows some angles that he can construct directly with the ruler and protractor. He can also add two constructible angles or subtract one from another to make a new angle. Any newly constructed angle can be used again in later constructions. Angles that differ by a full 360-degree turn are considered equivalent.
For each angle called by Hyunwoo, determine whether Changyeong can construct it.
The first line contains two integers N and K, the number of angles Changyeong initially knows how to construct and the number of angles Hyunwoo calls. (1 <= N, K <= 10)
The second line contains N angles that Changyeong can construct initially. Every angle is less than 360 degrees.
The third line contains K angles called by Hyunwoo. Each of these angles is also less than 360 degrees.
For each called angle, in the order given, print YES on its own line if Changyeong can construct it. Otherwise, print NO.