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?

Input

The first line of input contains an integer t (0 < t < 180) — the number of tests. Each of the following t lines contains a single integer a (0 < a < 180) — the angle the robot can make corners at measured in degrees.

Output

For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.

Examples

Input

3
30
60
90


Output

NO
YES
YES

Note

In the first test case, it is impossible to build the fence, since there is no regular polygon with angle <image>.

In the second test case, the fence is a regular triangle, and in the last test case — a square.
# for _ in range(int(input())):
#     n,k=map(int,input().split())
#     arr = [int(x) for x in input().split()]
    # c=[0]*n
    # #d=[]
    # i=0
    # x=0
    # while(max(arr)!=-1):
    #     x=k-arr[i]
    #     if(arr!=-1):
    #         c[arr.index(arr[i])]=1
    #         arr[arr.index(arr[i])]= -1
    #         if(x in arr):
    #             while(x in arr):
    #                 arr[arr.index(x)]= -1
    #                 if(x in arr):
    #                     c[arr.index(x)]=1
    #                     arr[arr.index(x)]= -1
    #     i+=1
    # print(" ".join(str(gh) for gh in c))
    # ans = 0
    # c=1
    # for i in range(n):
    #     if(2*arr[i] == k):
    #         c=c+1
    #         ans=(c)%2
    #     else:
    #         if(2*a[i]<k):
    #             ans = 0
    #         else:
    #             ans=1
    #     print(str(ans),end=" ")
    # print("\n")
########################
#                        #
#     COLOUR REVOLUTIONN    #
#                        #
#####################

# for _ in range(int(input())):
#     n,k=map(int,input().split())
#     if(k != 1):
#         a = abs((1-(k**4))//(1-k))
#         n1 = n//a
#     else:
#         n1 = 1
#     for i in range(4):
#         print(str(n1*(k**i)),end=' ')
#     print('\n')

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

#            CABEL CAR                 #

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

# r,g,b = map(int,input().split())
# co = -1
# while(r >0 or g>0 or b>0):
#     co += 1
#     r -= 2
#     if(r <=0 and g<=0 and b<=0):
#         break
#     co += 1
#     g -= 2
#     if(r <=0 and g<=0 and b<=0):
#         break
#     co+=1
#     b-=2
# print(co+30)

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

#            ROAD TO ZERO              #

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

# for _ in range(int(input())):
#     x,y = map(int, input().split())
#     a,b = map(int, input().split())
#     a1 = min(x,y)
#     b1=max(x,y)
#     op1=0
#     op2=0
#     if(a*2 <= b):
#         print((x+y)*a)
#     else:
#         op1=a1*b
#         op2=(b1-a1)*a
#         print(op1+op2)

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

#          FANCY FENCE                 #

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

from math import ceil,floor
for _ in range(int(input())):
    a = float(input())
    if(a==180):
        print("YES")
    else:
        n = 360/(180-a)
        if(ceil(n) == floor(n)):
            print("YES")
        else:
            print("NO")