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.
#1
'''
n=int(input())
line=input()
nums=[int(i) for i in line.split()]
s=0
t1=0
t2=0
for i in range(n):
    if nums[i]%2==0:
        s+=1
        t1=i+1
    else:
        t2=i+1
if s==1:
    print(t1)
else:
    print(t2)
'''

#2
'''
n,m=input().split()
n=int(n)
m=int(m)

res=[]

for i in range(n):
    nums=[int(num) for num in input().split()[1:]]
    res.extend(nums)

flag=0
for i in range(1,m+1):
    if i not in res:
        flag=1
if flag==1:
    print('NO')
else:
    print('YES')
'''


#3
'''
nums=[int(num) for num in input().split()]

print(max(nums)-min(nums))

'''

#4
'''
n=int(input())

if n==1:
    print('I hate it')
else:
    res='I hate '
    for i in range(1,n):
        if i%2==1:
            res+='that I love '
        else:
            res+='that I hate '
    res+='it'
    print(res)
'''

#5
'''
n=int(input())

nums=[int(num) for num in input().split()]

print(sum(nums)/n)
'''

#6   
'''
q=int(input())
for i in range(q):
    n=int(input())
    nums=[int(num) for num in input().split()]
    res=0
    for num in nums:
        if num<=2048:
            res+=num
        else:
            continue
    if res>=2048:
        print('YES')
    else:
        print('NO')
'''


#7

t=int(input())
for i in range(t):
    n=int(input())
    ang=180-n
    num=360/ang
    if ang*num!=360 or n<60:
        print('NO')
    else:
        print('YES')
    
    
    
    
    




    
    