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.
from cmath import inf
from re import T, X
import math
from tkinter import N, Y


def swap(a,b):
    a = a^b
    b = a^b
    a = a^b
    return a,b
    # call using a,b = swap(a,b)
def even(a):
    if a&1:
        return False
    return True
def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def lcm(x, y):
   lcm = (x*y) // gcd(x,y)
   return lcm

# it will return index of "key" in "sorted list". 
def BS_elemPosi(low, high, key, li):  
    while low<high:
        mid = (low+high)//2
        if li[mid]<=key:
            low = mid+1
        else:
            high = mid
    return low
     
###########################(CODE)##################################
# regular polygon
# single angle a
# 30/60 = 6
# 60/60 = 6
# 90/60 = 4
for i in range(int(input())):
    n = int(input())
    x = 180
    y = 3
    f = 0
    while x//y<=n:
        if x//y==n:
            f = 1
            break
        x+=180
        y+=1
        
    if f==1:
        print("YES")
    else:
        print("NO")





#####################################################################