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.
import sys
import io
import os

total = 0
failed = 0
def debug(*args):
    if('LOCALTEST' in os.environ):
        print(*args, file=sys.stderr)
def run(test,res):
    x = io.StringIO()
    with io.StringIO(test) as sys.stdin:
        with x as sys.stdout:
            work()
            z = x.getvalue().strip()
    sys.stdout = sys.__stdout__
    print("Passed?", z == res)
    print("Expected: ", res)
    print("Actual  : ", z)
    global total, failed
    total  += 1
    failed += 1 if (z != res) else 0

def work():
    t = int(input())
    for i in range(t):
        p = int(input())
        print("YES" if 360%(180-p)==0 else "NO")

def test():
    run("""3
30
60
90""", """NO
YES
YES""")


if('LOCALTEST' in os.environ):
    test()
    print("\n Result: %s (%d total, %d failed)" % ("FAILED" if (failed>0) else "PASSED", total, failed))
else:
    work()
