Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.

He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle *a*.

Will the robot be able to build the fence Emuskald wants? In other words, is there a regular polygon which angles are equal to *a*?
The first line of input contains an integer *t* (0 &lt; *t* &lt; 180) — the number of tests. Each of the following *t* lines contains a single integer *a* (0 &lt; *a* &lt; 180) — the angle the robot can make corners at measured in degrees.
'''
n,m,a=map(int,input().split())
if n%a==0:
    x=n//a
else :
    x=n//a+1
if m%a==0:
    y=m//a
else:
    y=m//a+1
print(x*y)
'''

'''
n=int(input())
x=0
for i in range(0,n,1)  :
    l=list(map(int,input().split()))
    s=0
    for j in l :
        s+=j
    if s>=2 :
        x+=1
print(x)
'''

'''
n,k=map(int,input().split())
l=list(map(int,input().split()))
y=k-1
if l[k-1]>0 :
    while l[y]==l[k-1] :
        y+=1
        if y==n :
            break
else :
    while l[y]<=0 :
        y-=1
        if y==-1 :
            break
    y+=1
print(y)
'''

'''
m,n=map(int,input().split())
max=(m*n)//2
print(max)
'''

'''
while True:
    try:
        str=input()
    except EOFError :
        break

    x = 0
    y = 0
    for i in range(0, len(str) - 1, 1):
        if str[i] == "@" and x == 0:
            x = i
        elif str[i] == "@" and x != 0:
            x = len(str) - 1
        elif str[i] == ".":
            y = i
    if x == 0 or str[0] == "." or str[-1] == "." or x==len(str) - 1 or str[x+1]=="." or str[x-1] == "."or y<x :
        print("NO")
    else:
        print("YES")
'''

'''
def f(m,l) :
    k=0
    for x in l :
        if x==m :
            k=k+1
    return k

q=int(input())
s=[]
for i in range(0,q,1) :
    n=int(input())
    l=list(map(int,input().split()))
    x=2048
    for j in range(11,-1,-1) :
        if x//(2**j)<f(2**j,l) :
            x=x%(2**j)
        else :
            x=x-f(2**j,l)*(2**j)
    if x==0 :
        s.append("YES")
    else :
        s.append("NO")
for y in s :
    print(y)
'''

t=int(input())
l=[]
s=[]
for i in range(0,t,1) :
    x=int(input())
    l.append(x)
for y in l :
    if 360%(180-y)==0 :
        s.append('YES')
    else :
        s.append('NO')
for z in s :
    print(z)
