Raju and Rani and playing games in the school. Raju has recently learned how to draw angles. 
He knows how to draw some angles. He also can add/subtract any of the two angles he draws. Rani now wants to test Raju.    

Input:
First line contains N and K, denoting number of angles Raju knows how to draw and K the number of angles Rani will tell Raju to draw. 
Next line contains, N space separated integers denoting the angles which Raju knows how to draw.    Next line contains K space separated numbers denoting the angles Rani wants Raju to draw.   

Output:
For each of the K angles Rani wants Raju to draw, output "YES" or "NO" (quotes for clarity) if he can draw those angles or not respectively.      

Constraints: 
1 ≤ N,K ≤ 10 
0 ≤ All\; angles ≤ 360

SAMPLE INPUT
1 2
100
60 70

SAMPLE OUTPUT
YES
NO

Explanation

Adding 100 fifteen times gives 1500 degrees, which is same as 60.
70 cannot be drawn any way.
s = raw_input()
numbers = map(int, s.split())

s = raw_input()
known_angles = map(int, s.split())

dic = {}

for angle in known_angles:
    dic[angle] = 1

for i in range(numbers[0]):
    for j in range(i, numbers[0]):
        dic[abs(known_angles[i]-known_angles[j])] = 1
        dic[(known_angles[i]+known_angles[j])%360] = 1

known_angles = dic.keys()

for angle in known_angles:
    rem = angle%360
    dic[rem] = 1
    sum = angle
    while 1:
        sum += angle
        new_rem = (sum)%360
        if new_rem==rem:
            break
        dic[new_rem] = 1

s = raw_input()
given_angles = map(int, s.split())

for angle in given_angles:
    if angle in dic.keys():
        print "YES"
    else:
        print "NO"