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=int(input())
##mis=0
##chris=0
##for i in range(n):
##    m,c=map(int,input().split())
##    if 1<=m<=6 and 1<=c<=6:
##        if m>c:
##            mis+=1
##        elif c>m:
##            chris+=1
##if mis>chris:
##    print("Mishka")
##elif chris>mis:
##    print("Chris")
##else:
##    print("Friendship is magic!^^")


##for i in range(13):
##    print("Надо было брать биткоин в 2012!")


##n=int(input())
##plus=0
##minus=0
##if 1<=n<=150:
##    for i in range(n):
##        a=input()
##        if "++" in a:
##            plus+=1
##        elif "--" in a:
##            minus-=1
##print(plus+minus)


##n=int(input())
##q=0
##z=[]
##y=0
##for i in range(n):
##    a,b=map(int,input().split())
##    q=q+b-a
##    z.insert(y, q)
##    y+=1
##print(max(z))


##q=input()
##n=int(input())
##for i in range(n):
##    print(q)


##n=int(input())
##count=0
##for i in range(n):
##    p,q=map(int,input().split())
##    if 0<=p<=100 and 0<=q<=100 and p<=q:
##        if (q-p)>=2:
##            count+=1
##print(count)


##k,n,w=map(int,input().split())
##summa=0
##a=1
##if 1<=k<=1000 and 1<=w<=1000 and 0<=n<=10**9:
##    for i in range(w):
##        summa=summa+k*a
##        a+=1
##if n>summa:
##    print(0)
##else:
##    print(abs(summa-n))


##n,k=map(int,input().split())
##if 2<=n<=10**9 and 1<=k<=50:
##    for i in range(k):
##        if n%10!=0:
##            n-=1
##        elif n%10==0:
##            n=n//10
##    print(n)

##n=int(input())
##a="I hate that "
##b="I love that "
##c=""
##for i in range(1,n+1):
##    if i%2==1:
##        if i==n:
##            c+="I hate it"
##        else:
##            c+=a
##    elif i%2==0:
##        if i==n:
##            c+="I love it"
##        else:
##            c+=b
##    
##if n==1:
##    print("I hate it")
##else:
##    print(c)
    

t=int(input())
for i in range(t):
    n=int(input())

    if n==60 or n==90 or n==108 or n==120 or n==135 or n==140 or n==144 or n==150:
        print("YES")
    else:
        print("NO")
