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 $30^{\circ}$.

In the second test case, the fence is a regular triangle, and in the last test case — a square.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Geometry

Implementation


Solutions:
t = int(input())
for i in range(t):
	a = int(input())
	n = 360 / (180 - a) % 1
	if n == 0:
		print('YES')
	else:
		print('NO')


a = int(input())
z = []
for j in range(3, 361):
	z.append(180 - 360 / j)
for i in range(a):
	s_i = int(input())
	if s_i in z:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	angle = int(input())
	if 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	nn = int(input())
	n = 3
	while (n - 2) * 180 / n < nn:
		n += 1
	print(['NO', 'YES'][(n - 2) * 180 / n == float(nn)])


t = int(input())
for i in range(t):
	a = int(input())
	n = 3
	while 180 * (n - 2) / n < a:
		n += 1
	if 180 * (n - 2) / n == a:
		print('YES')
	else:
		print('NO')


n_list = [3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360]
tests = int(input())

def is_regular(angle):
	for n in n_list:
		if angle == 180 - 360 / n:
			return True
	return False
for i in range(tests):
	if is_regular(int(input())):
		print('YES')
	else:
		print('NO')


import math

def solve():
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')
	return
t = int(input())
for i in range(t):
	solve()


n = int(input())
for _ in range(n):
	a = int(input())
	l = 180 - a
	print(['NO', 'YES'][360 % l == 0])


n = int(input())
for i in range(n):
	angle = int(input())
	if 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')


def fence():
	t = int(input())
	for _ in range(t):
		ang = float(input())
		for i in range(3, 1000):
			ans = float(180 * (i - 2) / i)
			if ans == ang:
				print('YES')
				break
			elif ans > ang:
				print('NO')
				break
fence()


for i in range(int(input())):
	print('NO' if 360 % (180 - int(input())) else 'YES')


import sys
import math
import bisect

def main():
	s = set()
	for i in range(3, 10 ** 6):
		if 180 * (i - 2) % i == 0:
			s.add(180 * (i - 2) // i)
	for _ in range(int(input())):
		a = int(input())
		if a in s:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
ans = []
for i in range(t):
	x = int(input())
	if 360 % (180 - x) == 0:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


t = int(input())
for i in range(t):
	k = int(input())
	n = 360 // (180 - k)
	if k * n % 180 == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	a = int(input())
	n = 360 / (180 - a)
	if float(n) == int(n):
		print('YES')
	else:
		print('NO')


tc = int(input())
while tc > 0:
	tc = tc - 1
	angle = int(input())
	an = 0
	boo = False
	n = 3
	while an <= 179:
		an = 180 - 360.0 / n
		if an == angle:
			boo = True
			break
		n = n + 1
	if boo:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
n = int(stdin.readline())
for x in range(n):
	a = int(stdin.readline())
	n = 360 / (180 - a)
	if n % 1 == 0:
		stdout.write('YES' + '\n')
	else:
		stdout.write('NO' + '\n')


n = int(input())
for i in range(n):
	angle = int(input())
	ane = -360 / (angle - 180)
	if int(ane) == float(ane):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	angle = int(input())
	l = []
	a = 180
	for t in range(3, 10000):
		if a % t == 0:
			l.append(a // t)
		a += 180
		if a // t > 180:
			break
	if angle in l:
		print('YES')
	else:
		print('NO')


II = lambda : int(input())
n = II()
for i in range(n):
	if 360 % (180 - II()):
		print('NO')
	else:
		print('YES')


def is_regular_polygon(angle):
	num_of_sides = 360 / (180 - angle)
	return num_of_sides == int(num_of_sides)
num_of_tests = int(input())
for _ in range(num_of_tests):
	angle = int(input())
	if is_regular_polygon(angle):
		print('YES')
	else:
		print('NO')


list = []
t = int(input())
for i in range(t):
	list.append(int(input()))
for i in range(t):
	if 360 % (180 - list[i]) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	i = 360 / (180 - n)
	if not i - int(i):
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
b = []
if 0 <= t and t <= 180:
	for i in range(t):
		a = int(input())
		if 360 % (180 - a) == 0:
			b.append('YES')
		else:
			b.append('NO')
	for i in range(t):
		print(b[i])
else:
	print('Nevernoe znach')


t = int(input())
while t:
	t -= 1
	a = int(input())
	if 360 / (180 - a) == 360 // (180 - a):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	k = 360 / (180 - n)
	print(['NO', 'YES'][int(k) == k])


t = int(input())
a = []
for i in range(0, t):
	a.append(int(input()))

def IsRegPolygon(p):
	if 360 % (180 - p) == 0:
		return 'YES'
	else:
		return 'NO'
ans = []
for i in a:
	ans.append(IsRegPolygon(i))
for i in ans:
	print(i)


n = int(input())
a1 = []
for i in range(n):
	a = int(input())
	if 360 % (180 - a) == 0:
		a1 += ['YES']
	else:
		a1 += ['NO']
for i in range(len(a1)):
	print(a1.pop(0))


t = int(input())
while t != 0:
	n = int(input())
	m = 360 / (180 - n)
	if m == int(m):
		print('YES')
	else:
		print('NO')
	t = t - 1


t = int(input())
for case in range(t):
	x = int(input())
	n = 360 / (180 - x)
	if int(n) == n:
		print('YES')
	else:
		print('NO')


import math

def solve():
	n = int(input())
	val = 360 / (180 - n)
	if val == int(val):
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


t = [(lambda x: 'NO' if 360 % (180 - x) != 0 else 'YES')(int(input())) for _ in range(int(input()))]
print('\n'.join(t))


n = int(input())
print('\n'.join(list([['YES', 'NO'][360 % (180 - int(input())) != 0] for _ in range(n)])))


l = [180 * (n - 2) / n for n in range(3, 10000)]
t = int(input())
for i in range(t):
	a = int(input())
	if a == 179:
		print('YES')
		continue
	print('YES') if a in l else print('NO')


options = []
for n in range(3, 361):
	if 180 * (n - 2) % n == 0:
		options.append(180 * (n - 2) // n)
cases = int(input())
for _ in range(cases):
	if int(input()) in options:
		print('YES')
	else:
		print('NO')


t = int(input(''))
angle = []
flag = 0
for i in range(t):
	angle.append(int(input('')))
for j in range(t):
	if 360 % (180 - angle[j]) == 0:
		print('YES')
		continue
	else:
		print('NO')
		continue


a = int(input())
for i in range(a):
	b = int(input())
	if 360 % (180 - b) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	a = int(input())
	if a >= 180:
		print('NO')
	else:
		b = (180 - a) / 2
		if a % b == 0:
			print('YES')
		else:
			print('NO')
	t = t - 1


for _ in range(int(input())):
	a = int(input())
	i = 3
	while i < 1000:
		z = (i - 2) * 180
		p = z / i
		i = i + 1
		if p == a:
			print('YES')
			break
		else:
			continue
	if p != a:
		print('NO')


n = int(input())
while n:
	x = int(input())
	if 360 / (180 - x) == int(360 / (180 - x)):
		print('YES')
	else:
		print('NO')
	n -= 1


t = int(input())
while t > 0:
	t -= 1
	angle = int(input())
	if angle < 60:
		print('NO')
		continue
	comp = 180 - angle
	print('YES' if 360 % comp == 0 else 'NO')


import sys
t = int(input())
while t:
	t -= 1
	n = int(input())
	valor = 180 - n
	if valor == 0:
		print('NO')
	elif 360 % valor == 0:
		print('YES')
	else:
		print('NO')


tc = int(input())
angles = [int(input()) for i in range(tc)]
for i in range(0, tc, 1):
	n = 360 % (180 - angles[i])
	if n == 0:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for _ in range(t):
	n = int(input())
	c = 180 - n
	s = 360 / c
	if abs(s - math.floor(s)) > 0:
		print('NO')
	else:
		print('YES')


n = int(input())
A = []
for i in range(0, n):
	a = int(input())
	A.append(a)
for j in range(0, n):
	if 360 % (180 - A[j]) == 0:
		print('YES')
	else:
		print('NO')


for j in range(int(input())):
	a = int(input())
	n = 360 / (180 - a)
	m = int(n)
	print('YNEOS'[n != m::2])


def gl(n):
	return 180 - 360 / n

def sn(x):
	return x == int(x)

def sg():
	v = [gl(x) for x in range(3, 361)]
	return set([x for x in v if sn(x)])

def ag(v):
	st = sg()
	for x in v:
		yield ('yes' if x in st else 'no').upper()
n = int(input())
v = []
for x in range(n):
	v.append(int(input()))
for x in ag(v):
	print(x)


res = []
for n in range(int(input())):
	a = int(input())
	ans = 360 % (180 - a)
	if ans == 0:
		res.append('YES')
	else:
		res.append('NO')
for x in res:
	print(x)


n = int(input())
from math import ceil
from math import floor
p = []
g = [0]
for t in range(0, n):
	p.append(int(input()))
for n in range(0, len(p)):
	c = 0
	if floor(360 / (180 - p[n])) == ceil(360 / (180 - p[n])):
		c = c + 1
		print('YES')
	if c == 0:
		print('NO')


polygons_number = int(input())
polygons = [int(input()) for i in range(polygons_number)]
[print('YES') if 360 % (180 - polygon) == 0 else print('NO') for polygon in polygons]


A = []
for i in range(3, 361):
	if 360 % i == 0:
		A.append(180 - 360 // i)
n = int(input())
B = []
for i in range(n):
	B.append(int(input()))
for i in range(n):
	if B[i] in A:
		print('YES')
	else:
		print('NO')


t = int(input())
while t != 0:
	a = int(input())
	d = 360 // (180 - a)
	n = 360 / (180 - a)
	if d == n:
		print('YES')
	else:
		print('NO')
	t -= 1


import math
t = int(input())
for i in range(t):
	a = int(input())
	x = 180 - a
	y = 360 / x
	if math.floor(y) == math.ceil(y):
		print('YES')
	else:
		print('NO')


n = int(input())
alis = []
for _ in range(n):
	alis.append(int(input()))
for a in alis:
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	v = 360 / (180 - n)
	if v == int(v):
		print('YES')
	else:
		print('NO')


n = int(input())
a = []
for i in range(n):
	degree = int(input())
	x = -360 / (degree - 180)
	x1 = int(x)
	if x1 == x:
		a.append('YES')
	else:
		a.append('NO')
for i in range(n):
	print(a[i])


n = int(input())
for i in range(0, n):
	x = int(input())
	a = 360 / (180 - x)
	if int(a) == a:
		print('YES')
	else:
		print('NO')


from sys import stdin, exit
import math
n = int(stdin.readline().rstrip())
l = []
for i in range(n):
	a = int(stdin.readline().rstrip())
	k = 360 / (180 - a)
	if math.ceil(k) - k == 0.0:
		print('YES')
	else:
		print('NO')


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
for _ in range(n):
	x = int(z())
	for i in range(3, 181):
		if 360 % (180 - x) == 0:
			print('YES')
			break
	else:
		print('NO')


A = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
t = int(input())
for i in range(t):
	a = int(input())
	if a in A:
		print('YES')
	else:
		print('NO')


num = int(input())
t = 0
while num > 0:
	t = int(input())
	if 360 % (180 - t):
		print('NO')
	else:
		print('YES')
	num = num - 1


import math
t = int(input())
for _ in range(t):
	n = int(input())
	x = 360 / (180 - n)
	if math.ceil(x) == math.floor(x):
		print('YES')
	else:
		print('NO')


n = int(input())
l = []
for i in range(n):
	p = int(input())
	if int(360 / (180 - p)) == 360 / (180 - p):
		l.append('YES')
	else:
		l.append('NO')
for i in l:
	print(i)


def check_polygon(angle):
	no_sides = -360 / (angle - 180)
	if no_sides - int(no_sides) == 0:
		return True
	else:
		return False
testcases = []
no_testcases = int(input())
for i in range(no_testcases):
	testcases.append(int(input()))
for testcase in testcases:
	if check_polygon(testcase):
		print('YES')
	else:
		print('NO')


t = int(input())
for q in range(t):
	x = int(input())
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


angle_ints = []
temp = 0
i = 3
while temp <= 179:
	temp = (i - 2) * 180 / i
	if temp == int(temp):
		angle_ints.append(temp)
	i += 1
num_rows = int(input())
yes_no = []
for i in range(0, num_rows):
	temp = int(input())
	if temp in angle_ints:
		yes_no.append('YES')
	else:
		yes_no.append('NO')
[print(i) for i in yes_no]


t = int(input(''))
lst = []
for i in range(t):
	a = int(input(''))
	lst.append(a)
for j in lst:
	if 360 % (180 - j) == 0:
		print('YES')
	else:
		print('NO')


import time, math
from sys import stdin, stdout

def I():
	return int(stdin.readline())

def In():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def Si():
	return sorted(list(map(int, stdin.readline().split())))

def Si():
	return sorted(list(map(int, stdin.readline().split())), reverse=True)

def P(x):
	return stdout.write(str(x) + '\n')

def Pi(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def solve():
	for i in range(I()):
		a = I()
		n = 360 / (180 - a)
		if float(int(n)) == n:
			P('YES')
		else:
			P('NO')
solve()


inputs = []
for i in range(int(input())):
	inputs.append(int(input()))
for i in inputs:
	sides = 3
	angle = 60
	while angle <= i:
		if angle == i:
			print('YES')
			break
		sides += 1
		angle = 180 * (sides - 2) / sides
	if angle != i:
		print('NO')
3


t = int(input())
b = []
c = []
d = ['YES']
e = ['NO']
for i in range(t):
	a = int(input())
	if 360 % (a - 180) == 0:
		b = b + d
	else:
		b = b + e
for i in range(len(b)):
	z = b[0]
	print(z)
	b.reverse()
	b.pop()
	b.reverse()


t = int(input())
for i in range(t):
	a = int(input())
	num = 360 / (180 - a)
	if num == int(num):
		print('YES')
	else:
		print('NO')


c = int(input())
while c > 0:
	v = int(input())
	if 360 % (180 - v) == 0:
		print('YES')
	else:
		print('NO')
	c = c - 1


angles = set()
for i in range(3, 361):
	tnc = (i - 2) * 180
	if tnc % i == 0:
		angles.add(tnc / i)
casos = int(input())
for i in range(casos):
	a = int(input())
	if a in angles:
		print('YES')
	else:
		print('NO')


n = int(input())
lim = 361
anglesd = [(n - 2) * 180 / n for n in range(3, lim)]
angles = [int(n) for n in anglesd if n.is_integer()]
for _ in range(n):
	a = int(input())
	if a in angles:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = 180 - n
	ans = 360 / a
	if ans >= 3:
		if ans.is_integer():
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


c = int(input())
for num in range(0, c):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
import math
for i in range(n):
	ang = int(input())
	d = 360 / (180 - ang) * 1.0
	if math.ceil(d) == d:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	ang = int(input())
	n = 3
	curr = (n - 2) * 180 / n
	while curr < ang:
		n += 1
		curr = (n - 2) * 180 / n
	if curr == ang:
		print('YES')
	else:
		print('NO')


n = int(input())
regular = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
for i in range(n):
	angle = int(input())
	print('YES' if angle in regular else 'NO')


n = int(input())
ar = []
for k in range(n):
	a = int(input())
	if 360 % (180 - a) == 0:
		ar = ar + ['YES']
	else:
		ar = ar + ['NO']
for t in ar:
	print(t)


n = int(input())
while n > 0:
	c = 0
	n = n - 1
	t = int(input())
	if t < 60:
		print('NO')
	else:
		i = 3
		while 1:
			if i * t == 180 * (i - 2):
				c = 1
				print('YES')
				break
			if i * t < 180 * (i - 2):
				break
			i = i + 1
		if c == 0:
			print('NO')


n = int(input())
for i in range(0, n):
	a = int(input())
	print(['NO', 'YES'][360 % (180 - a) == 0])


D = {60: 1, 90: 1, 108: 1, 120: 1, 135: 1, 140: 1, 144: 1, 150: 1, 156: 1, 160: 1, 162: 1, 165: 1, 168: 1, 170: 1, 171: 1, 172: 1, 174: 1, 175: 1, 176: 1, 177: 1, 178: 1, 179: 1}
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	if n in D:
		print('YES')
	else:
		print('NO')


import math
st = ''

def func(n):
	if 360 % (180 - n) == 0:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	n = int(input())
	st += str(func(n)) + '\n'
print(st)


import sys
my_file = sys.stdin
num = int(my_file.readline().strip('\n'))
angles = my_file.read().split()
angles = [int(i) for i in angles]
for i in angles:
	if 360 % (180 - i) > 0:
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	a = int(input())
	c = 180 - a
	if 360 / c * 10 % 10 == 0:
		print('YES')
	else:
		print('NO')


def angle(sides):
	return 180 - 360 / sides
t = int(input())
for i in range(t):
	k = 3
	a = int(input())
	test = angle(k)
	while test <= a:
		test = angle(k)
		if test == a:
			print('YES')
			break
		k += 1
	if test != a:
		print('NO')


query = int(input())
for _ in range(query):
	a = int(input())
	if a == 180:
		print('NO')
	else:
		n = 360 / (180 - a)
		p = int(n)
		if p >= 3:
			if p == n:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')


t = int(input())
for i in range(t):
	x = int(input())
	a = 180 - x
	if a <= 0:
		print('NO')
		continue
	if 360 % a == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	n1 = int(input())
	k = 360 / (180 - n1)
	if k == int(k):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = 180 - int(input())
	print('YNEOS'[360 % a != 0::2])


for i in range(int(input())):
	n = int(input())
	num = 360 / (180 - n)
	if num.is_integer():
		print('YES')
	else:
		print('NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		n = ii()
		f = 0
		for i in range(3, 20000):
			if n * i == (i - 2) * 180:
				print('YES')
				f = 1
				break
		if f == 0:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


test = int(input())
for t in range(test):
	a = int(input())
	n = 360 % (180 - a)
	if n == 0:
		print('YES')
	else:
		print('NO')


z = int(input())
while z:
	s = int(input())
	s = 180 - s
	if 360 % s:
		print('NO')
	else:
		print('YES')
	z -= 1


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007
for t in range(I()):
	a = I()
	if 360 % (180 - a) == 0:
		n = 360 // (180 - a)
		if n >= 3:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


a = int(input())
for i in range(0, a):
	b = int(input())
	c = 0
	d = 2
	while c / d < b:
		c += 180
		d += 1
		if c / d == b:
			print('YES')
			break
	else:
		print('NO')


x = int(input())
r = []
for i in range(x):
	y = int(input())
	if 360 % (180 - y) == 0:
		r.append('YES')
	else:
		r.append('NO')
for i in r:
	print(i)


l = []
for i in range(3, 100000):
	t_ang = 180 * (i - 2)
	each_ang = t_ang / i
	l.append(each_ang)
for _ in range(int(input())):
	n = int(input())
	print('YES' if n in l else 'NO')


(n, l) = (int(input()), [])
for _ in range(n):
	e = int(input())
	ans = 360 / (180 - e)
	if ans == int(ans):
		l.append('YES')
	else:
		l.append('NO')
for e in l:
	print(e)


for _ in range(int(input())):
	k = 360 % (180 - int(input()))
	if k != 0:
		k = 1
	print(['YES', 'NO'][k])


x = int(input())
mylist = [None] * x
for i in range(x):
	mylist[i] = int(input())
for i in range(x):
	y = 180 - mylist[i]
	res = 360 / y
	res2 = abs(res - int(res))
	if res2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
L = []
while t != 0:
	k = int(input())
	if 360 % (180 - k) == 0:
		L.append('YES')
	else:
		L.append('NO')
	t -= 1
for i in L:
	print(i)


n = int(input())
for i in range(n):
	coff = 360 / (180 - int(input()))
	if coff % 1 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	n = 360 / (180 - a)
	if n.is_integer():
		print('YES')
	else:
		print('NO')


a = int(input())
i = 1
while i <= a:
	b = int(input())
	c = int(abs(180 - b))
	if 360 % c == 0:
		print('YES')
	else:
		print('NO')
	i += 1


n = int(input())
for i in range(n):
	m = int(input())
	if (m > 0 and m < 180) and 360 % (180 - m) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	if a >= 60 and 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	a = int(input())
	if a < 60:
		print('NO')
	else:
		u = 360 % (180 - a)
		if u == 0:
			print('YES')
		else:
			print('NO')
	t -= 1


t = int(input())
for k in range(t):
	a = int(input())
	ans = 360 / (180 - a)
	if ans - int(ans) == 0 and int(ans) != 0:
		print('YES')
	else:
		print('NO')


n = int(input())
U = []
for i in range(3, 361):
	if not 360 % i:
		U.append(180 - 360 / i)
for i in range(n):
	print('YES') if int(input()) in U else print('NO')


n = int(input())
p = []
while n > 0:
	a = int(input())
	if 360 % (180 - a) != 0:
		p.append('NO')
	else:
		p.append('YES')
	n = n - 1
for i in range(0, len(p)):
	print(p[i])


for i in range(int(input())):
	angle = int(input())
	if angle < 60 or angle >= 180:
		print('NO')
	elif 360 / (180 - angle) % 1 == 0:
		print('YES')
	else:
		print('NO')


x = int(input())
list = []
k = float(0)
for j in range(3, 999):
	k += 180 * (j - 2) / j
	list.append(k)
	k = 0
for i in range(x):
	angle = int(input())
	if angle in list:
		print('YES')
		continue
	else:
		print('NO')


n = int(input())
ugol = storoni = 0
for i in range(n):
	ugol = int(input())
	if 360 % (180 - ugol) > 0:
		print('NO')
	else:
		print('YES')


t = int(input())
l = []
for i in range(t):
	a = float(input())
	n = 360 / (180 - a)
	if n * 10 ** 15 % 10 ** 15 / 10 ** 15 < 10 ** (-14):
		l.append('YES')
	else:
		l.append('NO')
print('\n'.join(l))


t = int(input())
x = []
for i in range(t):
	a = int(input())
	x.append(a)
for i in x:
	if int(360 / (180 - i)) / float(360 / (180 - i)) == 1.0:
		print('YES')
	else:
		print('NO')


for test in range(int(input())):
	n = int(input())
	e = 360 / (180 - n)
	if e >= 3 and int(e) == e:
		print('YES')
	else:
		print('NO')


from math import ceil as u
from math import floor as f

def solve(x):
	if x == 180 or x == 0:
		return False
	y = x / 180
	z = float(-2) / float(y - 1)
	if u(z) - z <= 10 ** (-9):
		z = u(z)
	elif z - f(z) <= 10 ** (-9):
		z = f(z)
	if (z - 2) * 180 / z == x and z == int(z):
		return True
	else:
		return False
t = int(input())
while t > 0:
	n = int(input())
	print('YES' if solve(n) else 'NO')
	t -= 1


t = int(input())
for j in range(t):
	n = int(input())
	for i in range(1, 500):
		if (i - 2) * 180 / i == n:
			c = 'YES'
			break
		else:
			c = 'NO'
	print(c)


for tc in range(int(input())):
	n = int(input())
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


def solve():
	num_tests = int(input())
	for i in range(num_tests):
		ang = int(input())
		if 360 % (180 - ang):
			print('NO')
		else:
			print('YES')
	return
solve()


def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	angle = 180 - 2 * (n / 2)
	ratio = 360 / angle
	if ratio == int(ratio):
		print('YES')
	else:
		print('NO')


t = int(input())
out = []
for i in range(t):
	n = int(input())
	if 360 % (180 - n) == 0:
		out.append('YES')
	else:
		out.append('NO')
for e in out:
	print(e)


tc = int(input())
for _ in range(tc):
	angle = int(input())
	n = 180 * 2 / (180 - angle)
	if int(n) == n:
		print('YES')
	else:
		print('NO')


p = int(input())
lst = []
for i in range(p):
	k = int(input())
	if 360 % (180 - k) == 0 and k < 180:
		lst.append('YES')
	else:
		lst.append('NO')
for el in lst:
	print(el)


import math
for testcases in range(int(input())):
	a = int(input())
	b = 180 - a
	c = 360 / b
	if c == int(c):
		print('YES')
	else:
		print('NO')


__author__ = 'linh'

def main():
	n0 = int(input())
	l = []
	for i in range(0, n0):
		angle = int(input())
		if angle >= 180 or angle < 60:
			l.append('NO')
		elif 360 % (180 - angle) == 0:
			l.append('YES')
		else:
			l.append('NO')
	for i in l:
		print(i)
main()


na = int(input())
x = []
for i in range(na):
	s = int(input())
	n = 360 / (180 - s)
	if n == int(n):
		x.append('YES')
	else:
		x.append('NO')
for i in range(na):
	print(x[i])


n = int(input())
for i in range(n):
	print('YNEOS'[360 / (180 - int(input())) % 1 != 0::2])


from math import *
t = int(input())
for i in range(t):
	x = int(input())
	if ceil(360 / (180 - x)) == 360 / (180 - x):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = 360 / (180 - n)
	s1 = 360 // (180 - n)
	if s == s1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	x = 360 / (180 - n)
	if n == 60 or n == 90 or n == 120 or (n == 108) or (n == 128.57) or (n == 135) or (n == 140) or (n == 144) or (n == 162) or (n == 180):
		print('YES')
	elif x == round(x):
		print('YES')
	else:
		print('NO')


p = int(input())
for i in range(p):
	n = int(input())
	if n < 60 or n >= 180:
		print('NO')
		continue
	n = 180 - n
	if 360 // n == 360 / n:
		print('YES')
	else:
		print('NO')


count = []
for i in range(3, 361):
	if 360 % i == 0:
		a = int(180 - 360 / i)
		count.append(a)
for t in range(int(input())):
	angle = int(input())
	if angle in count:
		print('YES')
	else:
		print('NO')


import sys
import math
tests = int(input())
for i in range(1, tests + 1):
	angle = int(input())
	doesExist = 360 % (180 - angle) == 0
	print('YES' if doesExist else 'NO')


import math
from decimal import Decimal

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
n = int(input())
for i in range(n):
	x = int(input())
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
answer = ''
for i in range(n):
	angle = int(input())
	c = 360 / (180 - angle)
	if int(c) == c:
		answer += 'YES\n'
	else:
		answer += 'NO\n'
print(answer)


t = int(input())
angles = {}
for angle in range(1, 180):
	angles[angle] = -360 / (angle - 180)
testCases = []
for x in range(t):
	testCases.append(int(input()))
for x in testCases:
	if angles[x] == int(angles[x]):
		print('YES')
	else:
		print('NO')


def fence(a):
	if a > 0 and a < 180:
		n = 3
		while int(180 * (n - 2) / n) < a:
			n += 1
		if 180 * (n - 2) / n == float(a):
			return 'YES'
	return 'NO'
n = int(input())
for i in range(n):
	print(fence(int(input())))


for i in range(int(input())):
	a = 180 - int(input())
	s = 0
	while s < 360:
		s += a
		if s == 360:
			print('YES')
	if s > 360:
		print('NO')


n = int(input())
numbers = list()
i = 0
while i < n:
	numbers.append(int(input()))
	i += 1
for i in numbers:
	n = 360 / (180 - i)
	if n % 1 == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
mas = []
velichina = []
for k in range(3, 1000):
	velichina.append(180 * (k - 2) / k)
for i in range(n):
	a = int(input())
	mas.append(a)
for p in mas:
	if p in velichina:
		print('YES')
	else:
		print('NO')


import sys
n = int(sys.stdin.readline())
for i in range(n):
	t = int(sys.stdin.readline())
	if 360 % (180 - t) == 0:
		print('YES')
	else:
		print('NO')


from math import modf
for _ in range(int(input())):
	a = int(input())
	k = 360 / (180 - a)
	(c, d) = modf(k)
	if c == 0.0:
		print('YES')
	else:
		print('NO')


def best_fence(test):
	for _value in range(test):
		corner = int(input())
		number_of_sides = 360 % (180 - corner)
		if number_of_sides == 0:
			print('YES')
		else:
			print('NO')
tests = int(input())
best_fence(tests)


t = int(input())
l = []
for i in range(t):
	angle = int(input())
	n = 360 / (180 - angle)
	if n == int(n):
		l.append('YES')
	else:
		l.append('NO')
for i in l:
	print(i)


prob_num = int(input())
list_trial = []
for i in range(0, prob_num):
	list_trial.append(int(input()))
for trial in list_trial:
	n = 1
	while trial / 180 > n / (n + 2):
		n += 1
	else:
		if trial / 180 == n / (n + 2):
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	j = 3
	while j < 10000:
		if a * j == 180 * (j - 2):
			print('YES')
			break
		j += 1
	if j == 10000:
		print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	if 2 * a / (180 - a) == int(2 * a / (180 - a)):
		print('YES')
	else:
		print('NO')


a = []
p = 1
for i in range(1, 1000):
	p = (i - 2) * (180 / i)
	if p % 1 == 0:
		a.append(p)
t = int(input())
for i in range(t):
	x = int(input())
	if x in a:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	n = 3
	while True:
		if 180 * (n - 2) == a * n:
			print('YES')
			break
		elif 180 * (n - 2) > a * n:
			print('NO')
			break
		n += 1


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def dist(x, y, c, d):
	return mt.sqrt((x - c) ** 2 + (y - d) ** 2)

def circle(x1, y1, x2, y2, r1, r2):
	distSq = ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) ** 0.5
	if distSq + r2 <= r1:
		return True
	else:
		return False
n = I()
for i in range(n):
	k = I()
	if 360 % (180 - k) == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	x = int(input())
	print(['NO', 'YES'][360 % (180 - x) == 0])


import math

def fact(n):
	ans = 1
	for i in range(2, n + 1):
		ans *= i
	return ans

def comb(n, c):
	return fact(n) // (fact(n - c) * c)
for _ in range(int(input())):
	n = int(input())
	ok = False
	for i in range(3, 1000):
		if (i - 2) * 180 == n * i:
			ok = True
	if ok:
		print('YES')
	else:
		print('NO')


a = list()
for i in range(3, 361):
	b = 180 - 360 / i
	a.append(b)
c = int(input())
for j in range(0, c):
	d = float(input())
	if d in a:
		print('YES')
	else:
		print('NO')


num = []
for i in range(3, 500):
	a = 180 * (i - 2) / i
	if a == int(a):
		num.append(int(a))
n = int(input())
for i in range(n):
	ang = int(input())
	if ang in num:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = int(input())
	if a and a != 180:
		print('YES' if (360 / (180 - a)).is_integer() else 'NO')
	else:
		print('NO')


ncases = int(input())
for k in range(ncases):
	t = int(input())
	if 360 / (180 - t) == int(360 / (180 - t)):
		print('YES')
	else:
		print('NO')


import sys
n = int(input())
for x in range(n):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	angle = int(input())
	s = 0
	for n in range(3, 361):
		if n * angle == (n - 2) * 180:
			s += 1
			break
	if s == 0:
		print('NO')
	else:
		print('YES')


def fancy_fence(a):
	if 360 % (180 - a) == 0:
		return 'YES'
	else:
		return 'NO'
t = int(input())
b = [int(input()) for i in range(t)]
for i in b:
	print(fancy_fence(i))


t = int(input())
list_of_angles = []
n = 3
while 180 * (n - 2) / n <= 179:
	if round(180 * (n - 2) / n) == 180 * (n - 2) / n:
		list_of_angles.append(round(180 * (n - 2) / n))
	n += 1
for i in range(t):
	angle = int(input())
	if angle in list_of_angles:
		print('YES')
	else:
		print('NO')


import sys

def main(angles):
	for angle in angles:
		theta = 180 - angle
		if 360 % theta == 0:
			print('YES')
		else:
			print('NO')
arr = []
for (e, line) in enumerate(sys.stdin.readlines()):
	if e == 0:
		continue
	arr.append(int(line.strip()))
main(arr)


import math

def hitungSisiPolygon(a):
	sisi = 360 / (180 - a)
	if sisi >= 3 and math.floor(sisi) == sisi:
		return 'YES'
	else:
		return 'NO'
n = int(input())
result = []
for i in range(n):
	a = int(input())
	result.append(hitungSisiPolygon(a))
for i in range(n):
	print(result[i])


n = int(input())
for a in range(n):
	angle = int(input())
	test = 360 / (180 - angle)
	if test - test // 1 == 0:
		print('YES')
	else:
		print('NO')


a = int(input())
i = 0
b = []
while i in range(a):
	b.append(int(input()))
	i += 1
r = len(b)
o = 0
u = []
while o in range(r):
	if b[o] == 180:
		print('NO')
	else:
		g = 360 / (180 - b[o])
		if int(g) == g:
			print('YES')
		else:
			print('NO')
	o += 1


angles = []
for i in range(1, 180):
	if 360 % (180 - i) == 0:
		angles.append(i)
N = int(input())
for i in range(0, N):
	if int(input()) in angles:
		print('YES')
	else:
		print('NO')


m = int(input())
for i in range(m):
	x = int(input())
	if 360 % (180 - x) != 0:
		print('NO')
	else:
		print('YES')


import sys
import math as mt
input = sys.stdin.buffer.readline
t = int(input())
for __ in range(t):
	n = int(input())
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
ar = []
w = 60
i = 1
r = 3
while w <= 179:
	i += 1
	r += 1
	ar.append(w)
	w = 180 * i / r
for i in range(n):
	m = int(input())
	if m in ar:
		print('YES')
	else:
		print('NO')


num_tests = int(input())
for test in range(num_tests):
	angle = int(input())
	print('YES') if 4 * angle % (360 - 2 * angle) == 0 else print('NO')


def ras(a):
	n = 3
	while True:
		if (n - 2) * 180 / n == a:
			return 'YES'
		if (n - 2) * 180 / n > a:
			return 'NO'
		n = n + 1
b = []
t = int(input())
for a in range(t):
	a = int(input())
	r = ras(a)
	b.append(r)
print(*b, sep='\n')


t = int(input())
for z in range(t):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
z = []
n = 3
while True:
	w = (n - 2) * 180 / n
	if w > 179:
		break
	z.append(w)
	n = n + 1
for tt in range(t):
	a = int(input())
	if a in z:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	n = int(input())
	x = print('YES') if not 360 % (180 - n) else print('NO')


import sys
input = sys.stdin.readlines()
input_list = []
for x in input:
	input_list.append(int(x))
input_list.reverse()
input_list.pop()
input_list.reverse()
for corner in input_list:
	for x in range(3, 1000):
		if 180 * (x - 2) / x == corner:
			print('YES')
			break
	else:
		print('NO')


import math
testcases = int(input())
for x in range(testcases):
	const = int(input())
	n = 360 / (180 - const)
	if n == math.floor(n):
		print('YES')
	else:
		print('NO')


n = int(input())
res = []
for i in range(n):
	l = int(input())
	if 360 / (180 - l) % 1 > 0:
		res += ['NO']
	else:
		res += ['YES']
for r in res:
	print(r)


angles = [0, 60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]

def bin_search(k):
	l = 0
	r = len(angles) - 1
	while l <= r:
		mid = l + (r - l) // 2
		if k == angles[mid]:
			return 1
		elif k > angles[mid]:
			l = mid + 1
		elif k < angles[mid]:
			r = mid - 1
	return -1
n = int(input())
x = []
for i in range(0, n):
	k = int(input())
	if bin_search(k) == -1:
		x.append('NO')
	else:
		x.append('YES')
for i in x:
	print(i)


from sys import stdin

def inp():
	return stdin.readline().strip()
sett = {60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179}
t = int(inp())
for _ in range(t):
	a = int(inp())
	if a in sett:
		print('YES')
	else:
		print('NO')


import math
cases = int(input())
for i in range(cases):
	s = 360 / (180 - int(input()))
	if s.is_integer():
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	if 360 % (180 - n) == 0 and 360 // (180 - n) > 2:
		print('YES')
	else:
		print('NO')
	t = t - 1


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def main():
	t = inp()
	for i in range(t):
		a = inp()
		n = 2 * 180 / (180 - a)
		if int(n) == int(ceil(n)):
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
s = []
for i in range(t):
	s.append(int(input()))
for i in range(t):
	d = 360 / (180 - s[i])
	if d == int(d):
		print('YES')
	else:
		print('NO')


N = int(input())
for i in range(N):
	n = int(input())
	if n == 180:
		print('NO')
	elif 360 / (180 - n) == int(360 / (180 - n)):
		print('YES')
	else:
		print('NO')


from itertools import count

def sum_of_interior(n):
	return (n - 2) * 180

def angle_of_polygon(n):
	return sum_of_interior(n) / n
t = int(input())
for _ in range(t):
	angle = int(input())
	sides = count(3)
	for s in sides:
		int_angle = angle_of_polygon(s)
		if int_angle == angle:
			print('YES')
			break
		if int_angle > angle:
			print('NO')
			break


t = int(input())
for cases in range(t):
	a = int(input())
	n = 360 % (180 - a)
	print('NO' if n else 'YES')


for _ in range(int(input())):
	a = int(input())
	n = 3
	while True:
		if (n - 2) * 180 // n >= a:
			break
		n += 1
	if (n - 2) * 180 % n == 0:
		if (n - 2) * 180 // n == a:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import math
t = int(input())
while t:
	k = int(input())
	x = 360 / (180 - k)
	y = math.floor(x)
	y = x - y
	if x >= 3 and y == 0:
		print('YES')
	else:
		print('NO')
	t = t - 1


a = int(input())
t = 3
lst = []
while 180 * (t - 2) / t <= 179:
	lst.append(180 * (t - 2) / t)
	t += 1
for i in range(a):
	s = int(input())
	if s in lst:
		print('YES')
	else:
		print('NO')


n = int(input().strip())
for _ in range(n):
	angle = int(input().strip())
	for i in range(3, 361):
		if (i - 2) * 180 / i == angle:
			print('YES')
			break
	else:
		print('NO')


test = int(input())
for i in range(test):
	a = int(input())
	i = 3
	answ = 'NO'
	while True:
		apr = (i - 2) * 180 / i
		if a == apr:
			answ = 'YES'
			break
		elif a < apr or a == 180:
			break
		else:
			i += 1
	print(answ)


def sol():
	t = int(input())
	for ti in range(t):
		n = int(input())
		print('YES' if 360 / (180 - n) > 2 and 360 % (180 - n) == 0 else 'NO')
sol()


t = int(input())
answers = []
for i in range(t):
	givenAngle = int(input())
	now = 360 / (180 - givenAngle)
	if now == int(now):
		answers.append('YES')
	else:
		answers.append('NO')
for answer in answers:
	print(answer)


for x in range(int(input().strip())):
	print('YES' if 360 / (180 - int(input().strip())) % 1 == 0 else 'NO')


import dis, sys, os.path
if os.path.exists('in_py.txt'):
	sys.stdin = open('in_py.txt', 'r')
	sys.stdout = open('out_py.txt', 'w')
input = sys.stdin.readline

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
i = 0
while i < t:
	a = inp()
	n = 360 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')
	i += 1


t = int(input())
for i in range(t):
	a = int(input())
	polygon = 3
	check = (polygon - 2) * (180 / polygon)
	f = 0
	while check <= a:
		if check == a:
			f = 1
			break
		polygon += 1
		check = (polygon - 2) * (180 / polygon)
	print('YES' if f else 'NO')


for n in range(int(input())):
	print(['NO', 'YES'][int(input()) in [180 * (i - 2) // i for i in range(1, 1000) if 180 * (i - 2) % i == 0]])


T = int(input())
while T > 0:
	T -= 1
	a = int(input())
	print('YES' if 360 % (180 - a) == 0 else 'NO')


n = int(input())
re = []
for i in range(n):
	a = int(input())
	if 360 / (180 - a) % 1 == 0:
		re.append('YES')
	else:
		re.append('NO')
for each in re:
	print(each)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def isqrt(n):
	x = n
	y = (x + 1) // 2
	while y < x:
		x = y
		y = (x + n // x) // 2
	return x

def abs(x):
	return x if x >= 0 else -x
for t in range(int(input())):
	x = int(input())
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
a = []
for x in range(t):
	a += [int(input())]

def temp(x):
	if 360 % (180 - int(a[x])) == 0:
		return True
	else:
		return False
for x in range(t):
	if temp(x):
		print('YES')
	else:
		print('NO')


t = int(input())

def check(a):
	if int(-360 / (a - 180)) == -360 / (a - 180):
		print('YES')
	else:
		print('NO')
for i in range(t):
	check(int(input()))


for T in range(int(input())):
	a = int(input())
	n = 360 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')


s = []
for n in range(3, 500):
	s.append((n - 2) * (180 / n))
for i in range(int(input())):
	l = int(input())
	if l in s:
		print('YES')
	else:
		print('NO')


def angle(x):
	if 360 % (180 - x) == 0:
		return 'YES'
	else:
		return 'NO'
for i in range(int(input())):
	print(angle(int(input())))


t = int(input())
for i in ' ' * t:
	print('YNEOS'[360 % (180 - int(input())) != 0::2])


x = int(input())
for i in range(x):
	m = int(input())
	n = 360 / (180 - m)
	p = 360 // (180 - m)
	if n == p:
		print('YES')
	else:
		print('NO')


res = ['NO', 'YES']
for _ in range(int(input())):
	n = int(input())
	print(res[360 % (180 - n) == 0])


t = int(input())
for i in range(t):
	a = int(input())
	(n, corner) = (3, 60)
	while corner < a:
		corner = 180 * (n - 2) / n
		n += 1
	print(['NO', 'YES'][corner == a])


n = int(input())
i = 0
while i < n:
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')
	i += 1


n = int(input())
lis = []
yes = 'YES'
no = 'NO'
for i in range(n):
	a = int(input())
	n = -360 / (a - 180)
	if n % 1 == 0:
		lis.append(yes)
	else:
		lis.append(no)
for i in lis:
	print(i)


t = int(input())
for i in range(t):
	int_angle = int(input())
	ext_angle = 180 - int_angle
	if 360 % ext_angle == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	q = int(input())
	ans = 360 // (180 - q)
	if ans * (180 - q) == 360:
		print('YES')
	else:
		print('NO')


ss = lambda : input()
si = lambda : int(input())
t = si()
for _ in range(t):
	a = si()
	print('YES' if (360 / (180 - a)).is_integer() else 'NO')


n = int(input())
seq = []
for i in range(3, 1000):
	if (i - 2) * 180 % i == 0:
		seq.append((i - 2) * 180 // i)
for i in range(0, n):
	n = int(input())
	if n in seq:
		print('YES')
	else:
		print('NO')


t = int(input())
f = 0
for l in range(0, t):
	d = int(input())
	c = 0
	for i in range(3, 1001):
		f = (i - 2) * 180 / i
		c = 0
		if f == d:
			print('YES')
			break
		else:
			c = 1
	if c == 1:
		print('NO')


def main():
	n = int(input())
	list1 = []
	for i in range(n):
		x = int(input())
		if 360 % (180 - x) == 0:
			list1.append('YES')
		else:
			list1.append('NO')
	for i in range(n):
		print(list1[i])
main()


t = int(input())
i = 1
while i <= t:
	c = int(input())
	if 360 % (180 - c) == 0:
		print('YES')
	else:
		print('NO')
	i += 1


n = int(input())
ans = []
for e in range(n):
	pang = int(input())
	ang = 180 - pang
	sang = ang
	while ang < 360:
		ang += sang
	if ang == 360:
		ans.append('YES')
	else:
		ans.append('NO')
for i in ans:
	print(i)


t = int(input())
a = [int(input()) for i in range(t)]
is_reg = ['NO'] * t
for i in range(t):
	if (60 <= a[i] < 180) & (360 % (180 - a[i]) == 0):
		is_reg[i] = 'YES'
[print(is_reg[i]) for i in range(t)]


s = [60, 90, 120]
for _ in range(int(input())):
	a = 180 - int(input())
	if 360 % a == 0:
		print('YES')
	else:
		print('NO')


cases = int(input())
for _ in range(cases):
	curAngle = int(input())
	n = int(360 / (180 - curAngle))
	if n == 360 / (180 - curAngle):
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	n = int(input())
	ret = 'NO'
	sides = 3
	while n >= (sides - 2) * 180 / sides:
		if n == (sides - 2) * 180 / sides:
			ret = 'YES'
			break
		else:
			sides += 1
	print(ret)


tc = int(input())
for tc_i in range(tc):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for _ in range(n):
	a = int(input())
	if not 360 % (180 - a):
		print('YES')
	else:
		print('NO')


t = int(input())
li = [180 * (i - 2) // i for i in range(3, 361) if 180 * (i - 2) // i == 180 * (i - 2) / i]
for i in range(t):
	a = int(input())
	if a in li:
		print('YES')
	else:
		print('NO')


y = input()
for i in range(0, int(y)):
	ai = input()
	a = int(ai)
	if a < 180:
		x = 360 / (180 - a)
		if x == int(x):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


e = int(input())
for x in range(e):
	a = int(input())
	a = 180 - a
	a = 1 / a
	a *= 360
	if a == int(a):
		print('YES')
	else:
		print('NO')


n = int(input())
output = []
for i in range(n):
	x = int(input())
	if 360 % (180 - x) == 0:
		output.append('YES')
	else:
		output.append('NO')
for k in output:
	print(k)


t = int(input(''))
for i in range(t):
	a = int(input(''))
	s = 360.0 / (180.0 - a)
	if s % 1 == 0:
		print('YES')
		continue
	print('NO')


tc = int(input())
for i in range(0, tc):
	ang = int(input())
	s = 360 % (180 - ang)
	if s == 0:
		print('YES')
	else:
		print('NO')


i = input
for x in range(int(i())):
	print('YNEOS'[360 % (180 - int(i())) > 0::2])


def fig(x):
	ans = 3
	while 180 * (ans - 2) / ans <= x:
		ans += 1
	ans -= 1
	if 180 * (ans - 2) / ans == x:
		return 'YES'
	else:
		return 'NO'
n = int(input())
for i in range(n):
	a = int(input())
	print(fig(a))


n = int(input())
while n > 0:
	n1 = int(input())
	if 360 % (180 - n1) == 0:
		print('YES')
	else:
		print('NO')
	n -= 1


k = int(input())
for i in range(0, k):
	u = int(input())
	if 360 % (180 - u) != 0:
		print('NO')
	else:
		print('YES')


def Polygon(a):
	if 360 % (180 - a) == 0:
		return 'YES'
	else:
		return 'NO'
x = int(input())
for i in range(x):
	y = int(input())
	print(Polygon(y))


exec(int(input()) * 'print("NO" if 360 % (180 - int(input())) else "YES");')


n = int(input())
q = []

def check(a):
	return 360 % (180 - a) == 0
for i in range(n):
	q = int(input())
	if 360 % (180 - q) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	es = False
	for i in range(3, 361):
		if (i - 2) * 180 == a * i:
			es = True
			break
	if es == True:
		print('YES')
	else:
		print('NO')


for i in [*open(0)][1:]:
	print('YNEOS'[360 % (180 - int(i)) > 0::2])


for t in range(int(input())):
	a = int(input())
	flag = 0
	if a < 60:
		flag = 0
	else:
		for n in range(3, 361):
			if (n - 2) * 180 / n == a:
				flag = 1
				break
	if flag == 0:
		print('NO')
	else:
		print('YES')


for t in range(int(input())):
	a = int(input())
	if 2 * 180 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


for ag in range(int(input())):
	n = int(input())
	i = 3
	ia = 60
	flag = 0
	while ia <= n:
		ia = (i - 2) * 180 / i
		if n == ia:
			flag = 1
			print('YES')
			break
		i = i + 1
	if flag == 0:
		print('NO')


def solve(x):
	if 360 / (180 - x) == 360 // (180 - x):
		return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	angle = int(input())
	print(solve(angle))


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest

def binNumber(n, size):
	return bin(n)[2:].zfill(size)

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
t = int(input())
for _ in range(t):
	a = int(input())
	n1 = 360 / (180 - a)
	n2 = 360 // (180 - a)
	if n1 == n2:
		print('YES')
	else:
		print('NO')


class Solution270A:

	def __init__(self):
		self.result = []
		self.alpha = 0
		self.cases = []

	def parse_input(self):
		t = int(input())
		for _ in range(t):
			self.cases.append(int(input()))

	def solve(self):
		for angle in self.cases:
			n = 360 / (180 - angle)
			if n.is_integer():
				self.result.append('YES')
			else:
				self.result.append('NO')

	def get_result(self):
		return '\n'.join(self.result)
solution = Solution270A()
solution.parse_input()
solution.solve()
print(solution.get_result())


from sys import stdin, stdout, maxsize
tup = lambda : map(int, stdin.readline().split())
I = lambda : int(stdin.readline())
lint = lambda : [int(x) for x in stdin.readline().split()]
stpr = lambda x: stdout.write(f'{x}' + '\n')
from math import ceil, log2
for _ in range(I()):
	n = I()
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	s = 0
	m = int(input())
	for j in range(358):
		if m * (j + 3) / (j + 1) == 180:
			s = 1
			break
	print('YES' if s == 1 else 'NO')


t = int(input())
for i in range(t):
	n = int(input())
	for j in range(3, 1000):
		if j * (180 - n) == 360:
			print('YES')
			break
	else:
		print('NO')


import sys
(tests, angles, i) = (0, [], 0)
for line in sys.stdin:
	numbers = [int(x) for x in line.strip().split()]
	if i == 0:
		(tests, i) = (numbers[0], 1)
		angles = [0] * tests
		continue
	angles[i - 1] = numbers[0]
	i += 1
for a in angles:
	if 360 / (180 - a) % 1 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	f = 360 / (180 - a)
	if f >= 3 and f % 1 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
c = 3
L = []
out = []
while True:
	if 180 * (c - 2) % c == 0:
		L.append(180 * (c - 2) // c)
	if 180 * (c - 2) // c == 179:
		break
	c = c + 1
for i in range(t):
	a = int(input())
	if a in L:
		out.append('YES')
	else:
		out.append('NO')
for x in out:
	print(x)


a = int(input())
for i in range(a):
	a = int(input())
	if 360 % (180 - a) == 0 and 360 / (180 - a) > 2:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
inp = []
for i in range(t):
	inp.append(int(input()))
for i in range(t):
	n = 2 / (1 - inp[i] / 180)
	if math.isclose(n, round(n)):
		print('YES')
	else:
		print('NO')


t = int(input())
for a in range(t):
	q = int(input())
	q = -360 / (q - 180)
	if q == int(q):
		print('YES')
	else:
		print('NO')


testCases = int(input())
for i in range(0, testCases):
	testCase = int(input())
	if 360 % (180 - testCase) == 0:
		print('YES')
	else:
		print('NO')


tries = int(input())
for t in range(tries):
	angle = int(input())
	if 360 / (180 - angle) == 360 // (180 - angle):
		print('YES')
	else:
		print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
for _ in range(get_int()):
	n = get_int()
	if n >= 180:
		print('NO')
	elif 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	r = []
	for _ in range(n):
		t = I()
		f = 0
		for i in range(3, 1000):
			if t * i / (i - 2) == 180:
				f = 1
				break
		if f:
			r.append('YES')
		else:
			r.append('NO')
	return '\n'.join(r)
print(main())


t = int(input())
for _ in range(t):
	n = int(input())
	n = 360 / (180 - n)
	if n.is_integer() == True:
		print('YES')
	else:
		print('NO')


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return [self.nextint() for i in range(n)]

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
N = nextint()
EPS = 1e-10
for _ in range(N):
	a = nextint()
	x = -2 / (a / 180 - 1)
	if int(x - EPS) != int(x + EPS):
		print('YES')
	else:
		print('NO')


n = int(input())
z = []
for i in range(0, n):
	x = int(input())
	n = 360 / (180 - x)
	z.append(n)
for j in range(0, len(z)):
	if int(z[j]) == z[j]:
		print('YES')
	if int(z[j]) != z[j]:
		print('NO')


x = int(input())
z = []
for i in range(x):
	a = int(input())
	n = 360 / (180 - a)
	if n % 1 == 0:
		z.append('YES')
	else:
		z.append('NO')
f = len(z)
w = 0
for j in range(f):
	print(z[w])
	w += 1


a = int(input())
i = 0
for i in range(0, a):
	i += 1
	b = int(input())
	if b < 60:
		print('NO')
	elif 360 % (180 - b) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
list1 = []
for i in range(n):
	x = int(input())
	flag = False
	for n in range(3, 10000):
		if abs(x - 180 * (n - 2) / n) < 1e-06:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
b = []
for i in range(t):
	a = int(input())
	if 360 / (180 - a) == int(360 / (180 - a)):
		b.append('YES')
	else:
		b.append('NO')
for i in b:
	print(i)


m = int(input())
for i in range(m):
	n = int(input())
	if n < 60 or n >= 180:
		print('NO')
	elif 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


import math

def fuck(x):
	return 360 / (180 - x)
case = int(input())
for i in range(0, case):
	t = int(input())
	if abs(math.floor(fuck(t)) - fuck(t)) < 1e-07:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	print('YNEOS'[bool(360 % (180 - int(input())))::2])


testcase = int(input())
for i in range(testcase):
	A = int(input())
	if 360 % (180 - A) == 0:
		print('YES')
	else:
		print('NO')


from math import floor
t = int(input())
for _ in range(t):
	k = int(input())
	n = 360 / (180 - k)
	if n % floor(n) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	p = 360 % (180 - x)
	if p != 0:
		print('NO')
	else:
		print('YES')


num_tests = eval(input())
for x in range(num_tests):
	angle = eval(input())
	interior = 180 - angle
	if 360 % interior == 0:
		print('YES')
	else:
		print('NO')


for i in [0] * int(input()):
	n = 2 * 180 / (180 - int(input()))
	print('YNEOS'[n != int(n)::2])


t = int(input())
for i in range(t):
	ang = int(input())
	n = 360 / (180 - ang)
	if int(n) == n:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	a = int(input())
	k = 1
	while k * (180 - a) < 360:
		k += 1
	print('YES' if k * (180 - a) == 360 else 'NO')


nums = int(input())
list1 = []
for i in range(nums):
	list1.append(int(input()))
for i in list1:
	if 360 % (180 - i) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
angle = []
for i in range(n):
	angle.append(input())
for each_angle in angle:
	test = 360 / (180 - int(each_angle))
	if float(test) == int(test) and float(test) >= 3:
		print('YES')
	else:
		print('NO')


t = int(input())
L = []
for _ in range(t):
	L.append(int(input()))
for angle in L:
	if 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
s1 = []
for i in range(n):
	s1.append(int(input()))
for i in range(n):
	k = s1[i]
	k2 = int(360 / (180 - k))
	if k2 * (180 - k) == 360:
		print('YES')
	else:
		print('NO')


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

def ip():
	return int(sys.stdin.readline())

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
t = ip()
while t:
	t -= 1
	n = ip()
	a = 360 / (180 - n)
	if a == int(a):
		print('YES')
	else:
		print('NO')


x = int(input())
for i in range(x):
	a = int(input())
	for n in range(3, 400):
		ans = (n - 2) * 180 / n
		if ans == float(a):
			print('YES')
			break
		elif ans > float(a):
			print('NO')
			break


data = set()
for i in range(1, 361):
	if 360 % i == 0:
		data.add(180 - 360 // i)
for i in range(int(input())):
	help = int(input())
	if help in data:
		print('YES')
	else:
		print('NO')


n = int(input())
z = []
y = []
for i in range(n):
	x = int(input())
	y.append(x)
for i in range(n):
	z.append(360 / (180 - y[i]))
	if z[i] == int(z[i]):
		print('YES')
	else:
		print('NO')


from math import *
from collections import deque
from copy import deepcopy
import sys

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def multi():
	return map(int, input().split())

def lis():
	return list(map(int, inp().split()))

def out(var):
	sys.stdout.write(str(var))

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(inp())
for i in range(n):
	x = int(inp())
	if 360 / (180 - x) - 360 // (180 - x) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
l = []
for i in range(n):
	a = int(input())
	s = 360 / (180 - a)
	if s == int(s):
		l.append('YES')
	else:
		l.append('NO')
for i in range(n):
	print(l[i])


inp = input().split()
n = int(inp[0])
numb = 0
for i in range(0, n):
	numb = int(input().split()[0])
	if 360 % (180 - numb) == 0:
		print(str('YES'))
	else:
		print(str('NO'))


for x in range(int(input())):
	print('YES' if 360 % (180 - float(input())) == 0 else 'NO')


n = int(input())
l = n * [0]
for i in range(n):
	l[i] = int(input())
ans = n * ['']
for i in range(n):
	t = 3
	while (t - 2) * 180 / t < l[i]:
		t = t + 1
	if (t - 2) * 180 / t == l[i]:
		ans[i] = 'YES'
	else:
		ans[i] = 'NO'
for i in ans:
	print(i)


T = int(input())
for _ in range(T):
	x = int(input())
	n = 360 / (180 - x)
	if n == int(n):
		print('YES')
	else:
		print('NO')


a = int(input())
for i in range(a):
	p = int(input())
	c = 360 / (180 - p)
	if c % 2 == 1 or c % 2 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t -= 1
	alpha = int(input())
	n = 360 / (180 - alpha)
	if n.is_integer():
		print('YES')
	else:
		print('NO')


q = int(input())
for _ in range(q):
	angle = int(input())
	temp = 360 / (180 - angle)
	if int(temp) == temp:
		print('YES')
	else:
		print('NO')


try:
	t = int(input())
	i = 0
	while i < t:
		n = int(input())
		a = 180 - n
		if 360 % a == 0:
			print('YES')
		else:
			print('NO')
		i += 1
except:
	pass


n = int(input())
l = []
for i in range(3, 5000):
	t = (i - 2) * 180 / i
	l.append(t)
for i in range(0, n):
	p = int(input())
	if float(p) in l:
		print('YES')
	else:
		print('NO')


import sys
Input = sys.stdin.readline
for i in range(int(Input())):
	n = int(Input())
	tmp = 180 - n
	print('NO' if 360 % tmp else 'YES')


n = int(input())
for _ in range(n):
	a = int(input())
	n1 = 360 / (180 - a)
	n2 = 360 // (180 - a)
	if n1 == n2:
		print('YES')
	else:
		print('NO')


nbTests = int(input())
for test in range(nbTests):
	angle = int(input())
	n = 360 / (180 - angle)
	if n.is_integer():
		print('YES')
	else:
		print('NO')


cases = eval(input())
for _ in range(cases):
	angle = eval(input())
	for side in range(3, 1000):
		guess = float(180 * (side - 2)) / side
		if guess == angle:
			print('YES')
			break
		if guess > angle:
			print('NO')
			break


n = int(input())
result = list()
for i in range(n):
	angle = int(input())
	z = 360 % (180 - angle)
	if z == 0:
		result.append('YES')
	else:
		result.append('NO')
for i in result:
	print(i)


mod = 10 ** 9 + 7
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
t = ii()
for _ in range(t):
	a = ii()
	n = 360 // (180 - a)
	print('YNEOS'[a != (n - 2) * 180 // n::2])


t = int(input())
for i in range(t):
	deg = int(input())
	if 360 % (180 - deg) == 0:
		print('YES')
	else:
		print('NO')


t = int(input().rstrip())
angles = []
for _ in range(t):
	angles.append(int(input().rstrip()))
import math
for x in angles:
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


def is_regular_angle(angle: int) -> int:
	return 1 if 360 % (180 - angle) == 0 else 0
n = int(input())
messages = ['NO', 'YES']
for _ in range(n):
	print(messages[is_regular_angle(int(input()))])


import math
l = []
n = 3
ans = 0
while ans <= 179:
	ans = (n - 2) * 180 / float(n)
	if math.floor(ans) == ans and ans <= 180:
		l.append(ans)
	n += 1
t = int(input())
for tp in range(t):
	g = int(input())
	if g in l:
		print('YES')
	else:
		print('NO')


a = int(input())
for _ in range(a):
	b = int(input())
	if 360 / (180 - b) % 1 == 0 and b != 0 and (b < 180):
		print('YES')
	else:
		print('NO')


for _ in range(int(input().strip())):
	angle = int(input().strip())
	print('YES' if int(360 / (180 - angle)) == 360 / (180 - angle) else 'NO')


def chk(n):
	for i in range(1, 1000):
		z = (i - 2) * 180 / i
		if z == n:
			return 1
	return 0
for _ in range(int(input())):
	if chk(int(input())):
		print('YES')
	else:
		print('NO')


q = int(input())
angulos = []
for _ in range(0, q):
	angulos.append(int(input()))
for a in angulos:
	if (360 / (180 - a)).is_integer():
		print('YES')
	else:
		print('NO')


for tc in range(int(input())):
	angle = int(input())
	ans = int(360 / (180 - angle)) - 360 / (180 - angle)
	if ans == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
s = []
for i in range(t):
	s.append(int(input()))
	if 360 / (180 - s[i]) >= 3 and 360 / (180 - s[i]) % 1 == 0:
		s[i] = 'YES'
	else:
		s[i] = 'NO'
for i in s:
	print(i)


import sys, math

def f(a):
	return 'YES' if 360 % (180 - a) == 0 else 'NO'
t = int(sys.stdin.readline())
for i in range(t):
	a = int(sys.stdin.readline())
	sys.stdout.write(f(a) + '\n')


angle = []
for i in range(3, 361):
	if int((i - 2) * 180 / i) == (i - 2) * 180 / i:
		angle.append(int((i - 2) * 180 / i))
angle = set(angle)
n = int(input())
a = []
for i in range(n):
	x = int(input())
	a.append(x)
for i in range(n):
	if a[i] in angle:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = int(input())
	n = 2 * 180 / (180 - a)
	n1 = 2 * 180 // (180 - a)
	if n == n1:
		print('YES')
	else:
		print('NO')


for _ in [0] * int(input()):
	print('YNEOS'[360 % (180 - int(input())) > 0::2])


n = int(input())
l = []
for i in range(n):
	l.append(int(input()))
for i in range(n):
	x = 360 / (180 - l[i])
	if x == int(x):
		l[i] = 'YES'
	else:
		l[i] = 'NO'
print(*l, sep='\n')


a = int(input())
a = int(a)
c = []
for _ in range(a):
	b = int(input())
	c.append(b)
for i in c:
	if 360 % (180 - i) == 0 and 360 // (180 - i) >= 3:
		print('YES')
	else:
		print('NO')


t = int(input())
la = [int(input()) for i in range(t)]
for a in la:
	if abs(-360 / (a - 180)) - int(abs(-360 / (a - 180))) == 0:
		print('YES')
	else:
		print('NO')


tests = int(input())
output = []
for i in range(tests):
	angle = int(input())
	if 360 % (180 - angle) == 0:
		output.append('YES')
	else:
		output.append('NO')
for i in output:
	print(i)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	side = 360 / (180 - n)
	if side == int(side):
		outln('YES')
		continue
	outln('NO')


n = int(input())
for i in range(n):
	a = int(input())
	if a <= 30:
		print('NO')
	elif 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
b = []
for i in range(t):
	a = int(input())
	d = 180 - a
	c = 360 / d
	if c > 2 and c == int(c):
		b.append('YES')
	else:
		b.append('NO')
for i in range(len(b)):
	print(b[i])


n = int(input())
possibles = {1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120}
results = []
for ele in possibles:
	results.append(180 - ele)
i = 7
for i in range(n):
	angle = int(input())
	if angle in results:
		print('YES')
	else:
		print('NO')


n = int(input())
p = [0] * n
for i in range(0, n):
	p[i] = int(input())
for j in range(0, n):
	if 360 % (180 - p[j]) == 0:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	a = int(input())
	n = 360 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')


t = int(input())
pol = set([180 * (i - 2) / i for i in range(3, 10000)])
for i in range(t):
	a = float(input())
	if a in pol:
		print('YES')
	else:
		print('NO')


from sys import stdin
a = [int(x.rstrip()) for x in stdin.readlines()][1:]
for x in a:
	if 360 % (180 - x):
		print('NO')
	else:
		print('YES')


q = int(input())
for i in range(q):
	a = int(input())
	if a < 60 or a > 179:
		print('NO')
	else:
		c = 3
		s = 0
		while s < a:
			s = (c - 2) * 180 / c
			c += 1
		if s == float(a):
			print('YES')
		else:
			print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	n1 = 360 % (180 - a)
	m1 = 360 / (180 - a)
	if n1 == 0 and m1 >= 3:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	an = int(input())
	j = 3
	nan = 0
	yes = 0
	while nan < an:
		nan = 180 - 360 / j
		if nan == an:
			yes += 1
			break
		j += 1
	print('YES' if yes == 1 else 'NO')


from math import *
for T in range(int(input())):
	a = int(input())
	n = 360 / (180 - a)
	if n > 2 and ceil(n) == floor(n):
		print('YES')
	else:
		print('NO')


n = int(input())
c = set()
m = 3
while m <= 360:
	if (m - 2) * 180 % m == 0:
		angle = (m - 2) * 180 // m
		c.add(angle)
	m += 1
for i in range(n):
	a = int(input())
	if a in c:
		print('YES')
	else:
		print('NO')


ls = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
n = int(input())
for i in range(n):
	print('NYOE S'[int(input()) in ls::2])


n = int(input())
l = []
for i in range(3, 1000):
	l.append((i - 2) * 180 / i)
for j in range(n):
	angle = int(input())
	if angle in l:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in ' ' * n:
	x = int(input())
	print('YES' if 360 // (180 - x) == 360 / (180 - x) else 'NO')


import math, os, sys
import string, re
import itertools, functools, operator
from collections import Counter

def inputint():
	return int(input())

def inputarray(func=int):
	return map(func, input().split())
n = inputint()
for _ in range(n):
	print('YES' if 360 % (180 - inputint()) == 0 else 'NO')


a = int(input())
mat = []
for i in range(a):
	s = int(input())
	mat.append(s)
k = 0
for i in range(a):
	k = 180 / mat[i] * 2 / (180 / mat[i] - 1)
	if int(k) + 1 - 1e-05 <= k <= int(k) + 1 + 1e-05 or int(k) - 1e-05 <= k <= int(k) + 1e-05:
		print('YES')
	else:
		print('NO')


import math

def is_angle(k):
	s = 360 / (180 - k)
	return ['NO', 'YES'][s - math.floor(s) < 10 ** (-5)]
n = int(input())
for i in range(n):
	print(is_angle(int(input())))


t = int(input())
for i in range(t):
	n = int(input())
	flag = 0
	for i in range(3, 1000):
		if n == (i - 2) * 180 / i:
			print('YES')
			flag = 1
			break
	if flag == 0:
		print('NO')


t = int(input())
output = []
while t != 0:
	a = int(input())
	if 360 % (180 - a) == 0:
		output.append('YES')
	else:
		output.append('NO')
	t -= 1
for x in range(len(output)):
	print(output[x])


n = int(input())
summ = []
alpha_regular = []
count = 0
flag = False
for i in range(60, 180):
	if 360 % (180 - i) == 0:
		alpha_regular.append(i)
		count += 1
for k in range(n):
	alpha = int(input())
	for j in range(count):
		if alpha == alpha_regular[j]:
			summ.append(1)
			flag = True
	if flag == False:
		summ.append(0)
	flag = False
for m in range(n):
	if summ[m] == 1:
		print('YES')
	else:
		print('NO')


tests = int(input())
for _ in range(tests):
	a = int(input())
	if 360 % (180 - a) == 0 and a >= 60:
		print('YES')
	else:
		print('NO')


def zabor():
	n = int(input())
	a = []
	for i in range(n):
		a.append(int(input()))
	for i in range(n):
		if a[i] <= 90 and a[i] != 60 and (a[i] != 90):
			print('NO')
		elif a[i] <= 90:
			print('YES')
		else:
			temp = True
			for j in range(5, 1000):
				if a[i] * j / 180 + 2 == float(j):
					print('YES')
					temp = False
					break
			if temp:
				print('NO')
zabor()


t = int(input())
f = ''
per = 0
for i in range(t):
	a = int(input())
	b = 180 - a
	c = 360 / b
	if c == int(c):
		f += 'YES '
	else:
		f += 'NO '
f = list(f.split())
for i in range(t):
	print(f[per])
	per += 1


t = int(input())
while t > 0:
	n = int(input())
	ext = 180 - n
	sides = 360 // ext
	print('YES' if sides * ext == 360 else 'NO')
	t -= 1


for q in range(int(input())):
	x = int(input())
	w = 360 / (180 - x)
	e = int(360 / (180 - x))
	if w == e:
		print('YES')
	else:
		print('NO')


def ff(angle):
	if 360 % (180 - angle) != 0:
		return 'NO'
	else:
		return 'YES'
cases = int(input())
results = list()
for case in range(0, cases):
	angle = int(input())
	results.append(angle)
for result in results:
	print(ff(result))


n = int(input())
for i in range(n):
	k = int(input())
	a = 360 / (180 - k)
	b = str(a)
	if b[-1] == '0':
		print('YES')
	else:
		print('NO')


n = int(input())
L = []
for i in range(n):
	m = int(input())
	L.append(m)
for i in range(n):
	if int(360 / (180 - L[i])) == 360 / (180 - L[i]):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	x = int(input())
	p = 0
	if x < 60 or x > 180:
		print('NO')
	else:
		for j in range(1, 10000):
			if 180 - 360 / j == x:
				print('YES')
				p = 1
				break
		if p == 0:
			print('NO')


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')


n = int(input())
for i in range(n):
	l = int(input())
	if 2 * l % (180 - l) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	alpha = int(input())
	angle = 180 - alpha
	if angle > 120:
		print('NO')
	elif 360 % angle == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
angles = []
for i in range(3, 10000):
	a = (i - 2) * 180
	a = a / i
	if int(a) == a:
		angles.append(a)
for test in range(t):
	n = int(input())
	if n in angles:
		print('YES')
	else:
		print('NO')


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = iinput()
s = []
for i in range(3, 370):
	l = (i - 2) * 180 / i
	if int(l) == l:
		s.append(l)
for i in range(n):
	a = iinput()
	for j in range(len(s)):
		if a == s[j]:
			print('YES')
			break
		if j == len(s) - 1:
			print('NO')


import sys
t = int(sys.stdin.readline().strip())

def doRequests(t):
	regular = {}
	for i in range(3, 50000):
		gr = (i - 2) * 180 / i
		if gr % 1 == 0:
			regular[int(gr)] = 'YES'
	for inp in range(t):
		try:
			print(regular[int(sys.stdin.readline())])
		except:
			print('NO')
doRequests(t)


def canBuild(angle):
	if 360 % (180 - angle) != 0:
		return 'NO'
	return 'YES'
for i in range(int(input())):
	print(canBuild(int(input())))


n = int(input())
for x in range(n):
	num = int(input())
	if num >= 60 and 360 % (180 - num) == 0:
		print('YES')
	else:
		print('NO')


from sys import stdin
import math
t = int(stdin.readline().rstrip())
while t > 0:
	a = int(stdin.readline().rstrip())
	n = 360 / (180 - a)
	if math.ceil(n) - n == 0.0:
		print('YES')
	else:
		print('NO')
	t -= 1


def verify_angle(angle):
	numbers_of_sides = 3
	while True:
		alpha = 360 / numbers_of_sides
		angle_of_poligon = 180 - alpha
		if angle == angle_of_poligon:
			return 'YES'
		if angle_of_poligon > angle:
			return 'NO'
		numbers_of_sides += 1
numbres_of_trys = int(input())
outputs = []
for _ in range(numbres_of_trys):
	angle_input = int(input())
	outputs.append(verify_angle(angle_input))
for output in outputs:
	print(output)


x = int(input())
f = []
for i in range(x):
	s = int(input())
	n = 360 / (180 - s)
	d = int(n)
	if float(d) == n:
		f.append('YES')
	else:
		f.append('NO')
for i in f:
	print(i)


r2 = []
for i in range(3, 2000):
	r2.append((i - 2) * 180 / i)
r2.sort()
i = int(input())
for k in range(0, i):
	d = int(input())
	if d not in r2:
		print('NO')
	else:
		print('YES')


import sys
t = int(input())
for i in range(t):
	a = int(input())
	print('NO' if 360 % (180 - a) else 'YES')


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\n30\n60\n90', 'NO\nYES\nYES')
if 'LOCALTEST' in os.environ:
	test()
	print('\n Result: %s (%d total, %d failed)' % ('FAILED' if failed > 0 else 'PASSED', total, failed))
else:
	work()


def fancyfence():
	datain = []
	a = []
	for i in range(int(input())):
		datain.append(int(input()))
	for i in range(3, 1000):
		a.append((i - 2) * 180 / i)
	for i in datain:
		if i in a:
			print('YES')
		else:
			print('NO')
fancyfence()


for c in '0' * int(input()):
	print('YNEOS'[-360 / (int(input()) - 180) % 1 != 0::2])


import math
x = int(input())
for i in range(x):
	a = int(input())
	n = 360 / (180 - a)
	h = math.floor(n)
	k = n % h
	if k == 0.0:
		print('YES')
	else:
		print('NO')


def main():
	n = int(input())
	for _ in range(n):
		angle = int(input())
		sides = round(2 * 180 / angle / (180 / angle - 1), 5)
		if sides.is_integer():
			print('YES')
		else:
			print('NO')
main()


Todos = [60.0, 90.0, 108.0, 120.0, 135.0, 140.0, 144.0, 150.0, 156.0, 160.0, 162.0, 165.0, 168.0, 170.0, 171.0, 172.0, 174.0, 175.0, 176.0, 177.0, 178.0, 179.0]

def SeEncuentra(Elem, A):
	Res = 'NO'
	for K in range(len(A)):
		if A[K] == Elem:
			Res = 'YES'
			break
	return Res
N = int(input(''))
Res = []
for K in range(N):
	Ang = int(input(''))
	ResPrima = SeEncuentra(Ang, Todos)
	Res = Res + [ResPrima]
for J in range(len(Res)):
	print(Res[J])


def Main():
	t = int(input())
	for i in range(t):
		a = int(input())
		if a > 59 and 360 % (180 - a) == 0:
			print('YES')
		else:
			print('NO')
Main()


num = int(input())
line = []
angel = []
for i in range(num):
	line.append(int(input()))
for i in range(3, 1000):
	check = (i - 2) * 180 / i
	if check == int(check):
		angel.append(int(check))
for i in range(num):
	if line[i] in angel:
		print('YES')
	else:
		print('NO')


import math
n = int(input())
l = list()
for i in range(n):
	l.append(int(input()))
for i in range(n):
	if (360 / (180 - l[i])).is_integer():
		print('YES')
	else:
		print('NO')


import sys

def readlines(type=int):
	return list(map(type, sys.stdin.readline().split()))

def read(type=int):
	return type(sys.stdin.readline().strip())
joint = lambda it, sep=' ': sep.join([str(i) if type(i) != list else sep.join(map(str, i)) for i in it])

def solve(angle):
	if 360 / (180 - angle) % 1 == 0.0:
		return 'YES'
	return 'NO'

def main():
	[print(solve(read())) for _ in range(read())]
main()


for _ in range(int(input())):
	n = int(input())
	s = 360 / (180 - n) + 2
	if int(s) == s:
		print('YES')
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline
t = int(input().strip())
for _ in range(t):
	a = int(input().strip())
	ok = 0
	for n in range(3, 1000):
		if (n - 2) * 180 % n == 0 and (n - 2) * 180 // n == a:
			ok = 1
			break
	if ok:
		print('YES')
	else:
		print('NO')


deg = []
n = 3
while n <= 360:
	if 180 * (n - 2) % n == 0:
		deg.append(int(180 * (n - 2) / n))
	n += 1
t = int(input())
i = 1
ans = []
while i <= t:
	w = int(input())
	if w in deg:
		ans.append('YES')
	else:
		ans.append('NO')
	i += 1
for an in ans:
	print(an)


t = int(input())
res = []
for i in range(t):
	ang = int(input())
	if 360 % (180 - ang) == 0:
		res.append('YES')
	else:
		res.append('NO')
for i in range(t):
	print(res[i])


t = int(input())
l = []
for i in range(t):
	l.append(int(input()))
for a in l:
	if float(360 / (180 - a)).is_integer() and 360 / (180 - a) > 0:
		print('YES')
	else:
		print('NO')


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
for _ in range(t):
	main()


test_num = int(input())
for i in range(test_num):
	in_angle = int(input())
	out_angle = 180 - in_angle
	if 1 <= out_angle <= 120:
		if 360 % out_angle == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import math
n = int(input())
l = []
for i in range(3, 180 * 178):
	a = 180 * (i - 2) / i
	if math.ceil(a) == math.floor(a):
		l.append(int(a))
for i in range(n):
	x = int(input())
	if x in l:
		print('YES')
	else:
		print('NO')


n = int(input())
list_of_angles = []
for i in range(n):
	list_of_angles.append(int(input()))
for j in list_of_angles:
	if 360 // (180 - j) == 360 / (180 - j):
		print('YES')
	else:
		print('NO')


from math import *
n = int(input())
i = 0
while i < n:
	m = int(input())
	c = floor(360 / (180 - m))
	d = ceil(360 / (180 - m))
	if 1 <= 360 / (180 - m) <= 360 and c == d:
		print('YES')
		i = i + 1
	else:
		print('NO')
		i = i + 1


from math import pi
n = int(input())
for i in range(n):
	x = int(input())
	b = True
	for j in range(3, 1000):
		if (180 - x) * j == 360:
			print('YES')
			b = False
	if b:
		print('NO')


def form(v):
	return (v - 2) * 180 // v

def solve():
	n = int(input())
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')
t = int(input())
while t > 0:
	solve()
	t -= 1


from io import StringIO
from sys import stdin, stdout
input = stdin.readline
print = stdout.write
c = input()
for _ in range(int(c)):
	a = int(input())
	if int(360 / (180 - a)) == 360 / (180 - a):
		print('YES')
		print('\n')
	else:
		print('NO')
		print('\n')


for _ in range(int(input())):
	angle = int(input())
	if 60 <= angle < 180:
		if not 360 % (180 - angle):
			print('YES')
			continue
	print('NO')


x = []
for n in range(3, 500):
	angle = (n - 2) * 180 / n
	if int(angle) == angle:
		x.append(int(angle))
a = [int(input()) for _ in range(int(input()))]
for i in a:
	if i in x:
		print('YES')
	else:
		print('NO')


x = int(input())
list = []
for i in range(x):
	list.append(int(input()))
for entry in list:
	if 180 * 2 % (180 - entry) == 0:
		print('YES')
	else:
		print('NO')


from math import floor
t = int(input())
ans = []
for _ in range(t):
	a = int(input())
	n = 360 / (180 - a)
	if floor(n) == n:
		ans.append('YES')
	else:
		ans.append('NO')
print('\n'.join(ans))


test = int(input())
for _ in range(test):
	angle = int(input())
	if float(360.0 / (180 - angle)) % 1 == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	if 360 / (180 - a) < 3 or 360 % (180 - a) != 0:
		print('NO')
	else:
		print('YES')


def EsRegular(angulo):
	Angulo = 180 - angulo
	if 360 % Angulo == 0:
		return 'YES'
	return 'NO'
casos = int(input())
for i in range(casos):
	angulo = int(input())
	print(EsRegular(angulo))


def good_angle(angle):
	exterior = 180 - angle
	if exterior == 0:
		return 'NO'
	n = 360 / exterior
	if n == int(n):
		return 'YES'
	else:
		return 'NO'

def main():
	first_line = input()
	n = int(first_line)
	angles = []
	for i in range(n):
		angle = input()
		angles += [int(angle)]
	for a in angles:
		print(good_angle(a))
main()


def main():
	t = int(input())
	ans = ('NO' if 360 % (180 - int(input())) else 'YES' for i in range(t))
	print(*ans, sep='\n')
main()


def solve():
	arr = []
	result = 0
	i = 3
	while result <= 179:
		result = (i - 2) * 180 / i
		if result % 1 == 0:
			arr.append(result)
		i += 1
	return arr
t = int(input())
result = solve()
for i in range(t):
	a = int(input())
	if a in result:
		print('YES')
	else:
		print('NO')


t = int(input())
for kk in range(t):
	a = int(input())
	if a < 60:
		print('NO')
		continue
	elif a == 60:
		print('YES')
		continue
	elif int(360 / (180 - a)) * (180 - a) == 360:
		print('YES')
		continue
	else:
		print('NO')
		continue


t = int(input())
for i in range(t):
	an = int(input())
	n = 360 / (180 - an)
	if n % 1 == 0 and n > 2:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	left = 2
	right = 1000000
	while left + 1 != right:
		mid = (left + right) // 2
		if 180 * (mid - 2) / mid >= a:
			right = mid
		else:
			left = mid
	if 180 * (right - 2) // right == a and 180 * (right - 2) % right == 0:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	found = False
	angle = int(input())
	for n in range(3, 1000):
		alpha = 180 - 360 / n
		if angle == alpha:
			print('YES')
			found = True
			break
	if found == False:
		print('NO')


n = eval(input())
for i in range(n):
	a = 180 - eval(input())
	if 360 % a:
		print('NO')
	else:
		print('YES')


t = int(input())
while t:
	x = int(input())
	n = 360 / (180 - x)
	if n - int(n) == 0 and n >= 3:
		print('YES')
	else:
		print('NO')
	t -= 1


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	for i in range(t):
		a = I()
		if 360 % (180 - a) == 0:
			pf('YES')
		else:
			pf('NO')
main()


from math import gcd
for i in range(int(input())):
	x = int(input())
	gcf = gcd(x, 180)
	(a, b) = (x // gcf, 180 // gcf)
	if b - a == 2 or b * 2 - a * 2 == 2:
		print('YES')
	else:
		print('NO')


a = int(input())
flag = 0
for i in range(a):
	b = float(input())
	n = 360 / (180 - b)
	f = int(n)
	if f == n:
		print('YES')
	else:
		print('NO')


cases = []
test = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
num = int(input())
for i in range(num):
	cases.append(int(input()))
for j in range(len(cases)):
	if cases[j] in test:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n1 = int(input())
	n = 360 / (180 - n1)
	if n == int(n) and n >= 3:
		print('YES')
	else:
		print('NO')


for __ in range(int(input())):
	n = int(input())
	print('YES' if 360 % (180 - n) == 0 and n < 180 else 'NO')


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for i in range(t):
	if 360 % (180 - int(input())) != 0:
		stdout.write('NO' + '\n')
	else:
		stdout.write('YES' + '\n')


def Fancy_Fence(a):
	n = 360 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	a = int(input())
	Fancy_Fence(a)


t = int(input())
p = []
for i in range(t):
	g = int(input())
	p.append(g)
for i in range(t):
	if 360 // (180 - p[i]) == 360 / (180 - p[i]):
		print('YES')
	else:
		print('NO')


n = int(input())
i = 0
while i < n:
	m = int(input())
	b = 0
	for j in range(1, 501, 1):
		if (j - 2) * 180 / j == m:
			b = 1
			break
	print('YES' if b else 'NO')
	i = i + 1


i = 1
angles = set()
while True:
	angle = 180 * i / (i + 2)
	if angle > 179:
		break
	if 180 * i % (i + 2) == 0:
		angles.add(int(angle))
	i += 1
t = int(input())
for i in range(t):
	x = int(input())
	if x in angles:
		print('YES')
	else:
		print('NO')


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
for i in range(N):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


tc = int(input())
while tc != 0:
	tc -= 1
	n = int(input())
	if n >= 60 and 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
j = 3
k = 1
palist = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
while t > 0:
	t -= 1
	angle = int(input())
	if angle in palist:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	A = int(input())
	angle = 60
	i = 4
	while A > angle:
		angle = (i - 2) * 180 / i
		i += 1
	print('YES' if A == angle else 'NO')


N = int(input())
X = [int(input()) for _ in range(N)]
for x in X:
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


def solve(a):
	n = 360 / (180 - a)
	if n.is_integer():
		return True
	else:
		return False
n = int(input())
for i in range(n):
	t = int(input())
	if solve(t):
		print('YES')
	else:
		print('NO')


test_num = int(input())
a = 0
test = []
for a in range(test_num):
	test.append(int(input()))
for a in range(len(test)):
	if 360 % (180 - test[a]) == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(Angle, N) = (int(input()), 3)
	while Angle * N > (N - 2) * 180:
		N += 1
	print('YES' if Angle * N == (N - 2) * 180 else 'NO')


n = int(input())
while n:
	n -= 1
	angle = int(input())
	i = 3
	while True:
		if (i - 2) / i * 180 == angle:
			print('YES')
			break
		if (i - 2) / i * 180 > angle:
			print('NO')
			break
		i += 1


for _ in range(int(input())):
	a = int(input())
	a = (a << 1) / (180 - a)
	print('NO' if int(a) != a else 'YES')


test = int(input())
for i in range(test):
	degree = int(input())
	if 360 % (180 - degree) == 0 and degree >= 60:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	d = int(input())
	if 360 / (180 - d) % 1 == 0:
		print('YES')
	else:
		print('NO')


for c in '0' * int(input()):
	print('YNEOS'[not (-360 / (int(input()) - 180)).is_integer()::2])


N = int(input())
for i in range(0, N):
	a = int(input())
	if 360 % (180 - a) == 0 and 360 // (180 - a) >= 3:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi
import heapq

def I():
	return int(input())

def In():
	return map(int, input().split())

def main():
	try:
		a = I()
		if 360 % (180 - a) == 0:
			print('YES')
		else:
			print('NO')
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


n = int(input())
for i in range(1, n + 1):
	a = int(input())
	if a <= 90:
		if a == 60 or a == 90:
			print('YES')
		else:
			print('NO')
	else:
		kol_stor = 360 / (180 - a)
		if kol_stor.is_integer() == True:
			print('YES')
		else:
			print('NO')


t = int(input())
results = [True for i in range(t)]
for i in range(t):
	a = int(input())
	if 360 % (180 - a) != 0:
		results[i] = False
for r in results:
	if r:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	p = 0
	a = int(input())
	if a < 60 or a > 180:
		print('NO')
	else:
		for x in range(3, 361):
			if 180 - 360 / x == a:
				print('YES')
				p = 1
				break
		if p == 0:
			print('NO')


t = int(input())
for x in range(t):
	a = int(input())
	res = 360 / (180 - a)
	if res.is_integer() == True:
		print('YES')
	else:
		print('NO')


import sys, threading, os.path
import collections, heapq, math, bisect
import string
from platform import python_version
import itertools
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)

def main():
	if os.path.exists('input.txt'):
		input = open('input.txt', 'r')
	else:
		input = sys.stdin
	n = int(input.readline())
	sol = []
	angles = []
	j = 3
	while True:
		x = float((j - 2) * 180 / j)
		angles.append(x)
		j += 1
		if j > 10000:
			break
	for i in range(n):
		t = int(input.readline())
		if t in angles:
			sol.append('YES')
		else:
			sol.append('NO')
	output = '\n'.join(map(str, sol))
	if os.path.exists('output.txt'):
		open('output.txt', 'w').writelines(str(output))
	else:
		sys.stdout.write(str(output))
main()


ans = ['YES', 'NO']
poss = [(n - 2) * 180 // n for n in range(3, 361) if (n - 2) * 180 / n == (n - 2) * 180 // n]
for _ in range(int(input().strip())):
	angle = int(input().strip())
	print(ans[angle not in poss])


def canFormPolygon(theta):
	if 360 % (180 - theta) == 0:
		return 'YES'
	return 'NO'
test_cases = int(input())
for i in range(test_cases):
	theta = int(input())
	print(canFormPolygon(theta))


l1 = []
a = int(input())
b = 3
for i in range(a):
	c = int(input())
	while (b - 2) * 180 / b < c:
		b = b + 1
	if (b - 2) * 180 / b == c:
		l1.append('YES')
	else:
		l1.append('NO')
	c = 0
	b = 3
for x in l1:
	print(x)


n = int(input())
l = []
for i in range(3, 500):
	a = 180 * (i - 2)
	b = a / i
	l.append(b)
for i in range(n):
	k = int(input())
	if k in l:
		print('YES')
	else:
		print('NO')


ang = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
for x in range(int(input())):
	if int(input()) in ang:
		print('YES')
	else:
		print('NO')


n = int(input())

def verify_angle(angle):
	side = 360 / (180 - angle)
	if side % 1 == 0:
		return True
	return False
ans = []
for entry in range(n):
	angle = int(input())
	if verify_angle(angle):
		ans.append('YES')
	else:
		ans.append('NO')
for answer in ans:
	print(answer)


t = int(input())
for i in range(t):
	a = int(input())
	k = 360 / (180 - a)
	if int(k ** 2) ** 0.5 == k:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	theta = int(input())
	m = 360 / (180 - theta)
	if m.is_integer():
		print('YES')
	else:
		print('NO')


cases = int(input())
x = 0
while x < cases:
	interiorAngle = int(input())
	ExteriorAngle = 180 - interiorAngle
	numOfEdgesFloat = 360 / ExteriorAngle
	numOfEdgesInt = 360 // ExteriorAngle
	if numOfEdgesFloat == numOfEdgesInt:
		print('YES')
	else:
		print('NO')
	x += 1


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))
ans = []
t = ini()
for _ in range(t):
	n = ini()
	ans.append('YES' if 360 % (180 - n) == 0 else 'NO')
out(ans)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
nb_test = read_int()
for _ in range(nb_test):
	print('YES' if 360 % (180 - read_int()) == 0 else 'NO')


a = int(input())
l = [i for i in range(10000)]
d = []
for i in range(a):
	c = int(input())
	e = 360 / (180 - c)
	if e in l:
		d.append('YES')
	else:
		d.append('NO')
for i in range(len(d)):
	print(d[i])


import math
t = int(input())
while t > 0:
	a = int(input())
	print('YES' if math.floor(360.0 / float(a - 180.0)) == 360.0 / float(a - 180.0) else 'NO')
	t -= 1


y = 'YES'
n = 'NO'

def ai(s):
	if 360 % (180 - s) == 0:
		print(y)
	else:
		print(n)
k = int(input())
for i in range(k):
	ai(int(input()))


import math
for i in range(int(input())):
	a = int(input())
	poly = 1 / ((180 - a) / 360)
	if math.floor(poly) == poly:
		print('YES')
	else:
		print('NO')


tests = int(input())
results = []
for x in range(tests):
	angle = int(input())
	if 360 % (180 - angle) == 0:
		results.append('YES')
	else:
		results.append('NO')
for x in results:
	print(x)


entradas = []
while True:
	try:
		entradas.append(int(input()))
	except EOFError:
		break
for entrada in entradas[1:]:
	angulo_externo = 180 - entrada
	lados = 360 % angulo_externo
	if not lados:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	A = int(input())
	k = 3
	while True:
		a = 180 - 2 * 180 / k
		if a == A:
			print('YES')
			break
		if a > A:
			print('NO')
			break
		k += 1


t = int(input())
for i in range(t):
	n = int(input())
	j = 3
	p = 0
	while p < n:
		p = (j - 2) * 180 / j
		j += 1
	if p == n:
		print('YES')
	else:
		print('NO')


ty = int(input())
for hd in range(ty):
	d = int(input())
	if 360 % (180 - d) == 0:
		print('YES')
	else:
		print('NO')


T = int(input())
for k in range(T):
	N = int(input())
	N = 180 - N
	if 360 % N == 0:
		print('YES')
	else:
		print('NO')


angle = {}
for n in range(3, 1000):
	a = 180 * (n - 2) / n
	if a > 179:
		break
	if a % 1 == 0:
		angle[n] = int(a)
t = int(input())
for test in range(t):
	a = int(input())
	if a in angle.values():
		print('YES')
	else:
		print('NO')


n = int(input())
b = []
for i in range(n):
	a = int(input())
	x = -360 / (a - 180)
	x1 = -360 // (a - 180)
	if x1 == x:
		b.append(1)
	else:
		b.append(0)
for i in b:
	if i == 0:
		print('NO')
	else:
		print('YES')


x = int(input())
for i in range(x):
	y = int(input())
	b = 180 - y
	if 360 / (180 - y) == 360 // (180 - y):
		print('YES')
	else:
		print('NO')


tests = int(input())
ok = 0
for i in range(tests):
	angle = int(input())
	for j in range(3, 2001):
		if (180 * (j - 2) / angle).is_integer() and 180 * (j - 2) / angle == j:
			ok = 1
	if ok:
		print('YES')
		ok = 0
	else:
		print('NO')


def main():
	t = int(input())
	for __ in range(t):
		y = int(input())
		if 360 % (180 - y) == 0:
			print('YES')
		else:
			print('NO')
main()


import math

def main():
	n = int(input())
	all = set()
	for i in range(3, 1001):
		if (i - 2) * 180 % i == 0:
			all.add((i - 2) * 180 // i)
	for _ in range(n):
		a = int(input())
		print('YES' if a in all else 'NO')
main()


n = int(input())
for i in range(n):
	a = float(input())
	z = 360 / (180 - a)
	if z > 2 and z % 1 == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	if n > 30 and n < 180:
		if 360 / (180 - n) == int(360 / (180 - n)):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


T = int(input())
for i in range(T):
	x = int(input())
	temp = 180 - x
	if 360 % temp == 0:
		print('YES')
	else:
		print('NO')


import sys
t = int(sys.stdin.readline().rstrip())
tests = []
for _ in range(t):
	tests.append(int(sys.stdin.readline().rstrip()))

def hasAngle(a):
	return (360 / float(180.0 - a)).is_integer()
for test in tests:
	if hasAngle(test):
		print('YES')
	else:
		print('NO')


n = int(input())
answers = []
for i in range(n):
	a = int(input())
	s = 360 / (180 - a)
	if int(s) == s and s >= 3:
		ans = 'YES'
	else:
		ans = 'NO'
	answers.append(ans)
for i in answers:
	print(i)


t = int(input())
b = []
if 0 <= t and t <= 180:
	for i in range(t):
		a = int(input())
		for i in range(3, 1000):
			if a == (i - 2) / i * 180:
				ot = 'YES'
				break
			else:
				ot = 'NO'
		b.append(ot)
	for i in range(t):
		print(b[i])
else:
	print('Nevernoe znach')


num = input()
angles = []
for i in range(int(num)):
	angles.append(int(input()))
for i in angles:
	if 360 % (180 - i) == 0:
		print('YES')
	else:
		print('NO')


l1 = []
for i in range(1, 121):
	if 360 % i == 0:
		l1.append(180 - i)
t = eval(input())
for i in range(t):
	a = eval(input())
	if a in l1:
		print('YES')
	else:
		print('NO')


R = lambda : list(map(int, input().split()))
k = int(input())
for _ in range(k):
	x = int(input())
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	v = float(input())
	if 360 % (180 - v) == 0:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	n = int(input())
	hands = 3
	guess = 3
	while True:
		angels = n * guess
		ans = (guess - 3) * 180 + 180
		if angels == ans:
			print('YES')
			break
		elif angels < ans:
			print('NO')
			break
		guess += 1


n_sets = int(input())
for _ in range(n_sets):
	alpha = int(input())
	n = 360 / (180 - alpha)
	if abs(n - int(n)) < 1e-06:
		print('YES')
	else:
		print('NO')


n = int(input())
num_sides = 3
interior_angle = 60
all_angles_list = list()
while interior_angle < 179.1:
	all_angles_list.append(interior_angle)
	num_sides += 1
	exterior_angle = 360 / num_sides
	interior_angle = 180 - exterior_angle
for i in range(n):
	a = int(input())
	if a in all_angles_list:
		print('YES')
	else:
		print('NO')


n = int(input())
list1 = []
for i in range(3, 190):
	if int((i - 2) * 180 % i) == 0:
		list1.append((i - 2) * 180 // i)
	list1.append(179)
for i in range(n):
	k = int(input())
	if k in list1:
		print('YES')
	else:
		print('NO')


n = int(input())
ar = [] * n
for i in range(0, n):
	x = float(input())
	ar.append(x)
for i in range(0, n):
	flag = False
	side = 3
	angle = 0
	while angle <= ar[i]:
		if angle == ar[i]:
			flag = True
			break
		angle = (side - 2) * 180 / side
		side += 1
	if flag:
		print('YES')
	else:
		print('NO')


testcase = int(input())
for i in range(testcase):
	A = int(input())

	def regularpolygon(A):
		for n in range(1, 100000):
			if n * (180 - A) - 360 == 0:
				return n
	if regularpolygon(A) is not None:
		print('YES')
	else:
		print('NO')


count = int(input())
for x in range(count):
	angle = int(input())
	print(['NO', 'YES'][360 % (180 - angle) == 0])


size = int(input())
agreeList = []
for i in range(0, size):
	agreeList.append(int(input()))
for i in agreeList:
	sum = 360 / (180 - i)
	if sum - int(sum) > 0:
		print('NO')
	else:
		print('YES')


def main():
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')
T = int(input())
for _ in range(T):
	main()


for i in range(int(input())):
	p = int(input())
	j = 3
	while p > 180 - 360 / j:
		j += 1
	if p == 180 - 360 / j:
		print('YES')
	elif p < 180 - 360 / j:
		print('NO')


fok = lambda a: 360 % (180 - a) == 0 and 360 // (180 - a) > 2
[print('YES' if fok(int(input())) else 'NO') for _ in range(int(input()))]


x = int(input())
re = ''
while x != 0:
	y = int(input())
	if 360 % (180 - y) == 0:
		re = re + '\n' + 'YES'
	else:
		re = re + '\n' + 'NO'
	x -= 1
print(re)


i = input
exec(int(i()) * 'print("YNEOS"[360%(180-int(i()))>0::2]);')


t = int(input())
for i in range(t):
	a = int(input())
	s = 360 / (180 - a)
	if s - int(s) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
li = []
angle = 180
num = 3
while angle / num <= 179:
	if angle % num == 0:
		li.append(angle // num)
	angle += 180
	num += 1
for i in range(n):
	t = int(input())
	if t in li:
		print('YES')
	else:
		print('NO')


class class1:

	def __init__(self, deg):
		self.deg = deg

	def calucalte(self):
		self.n = 360 // (180 - self.deg)
		return (self.n - 2) * 180 // self.n == self.deg

	def printvalue(self):
		if self.calucalte():
			print('YES')
		else:
			print('NO')
n = int(input())
myList = []
for i in range(n):
	num = int(input())
	myList.append(class1(num))
for i in range(n):
	myList[i].printvalue()


n = int(input())
x = []
for i in range(n):
	m = int(input())
	x.append(m)
for j in range(n):
	if 360 % (180 - x[j]) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
a = []
for i in range(0, n):
	s = int(input())
	if not s == 0 and (not s == 180) and (360 % (180 - s) == 0):
		a.append('YES')
	else:
		a.append('NO')
for i in range(0, n):
	print(a[i])


yes = [0 for i in range(400)]
for i in range(1, 361):
	if 360 % i == 0:
		yes[180 - 360 // i] = 1
t = int(input())
for __ in range(t):
	x = yes[int(input())]
	if x:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	b = 0
	for j in range(1, 1000):
		if (j - 2) * 180 / j == n:
			b = 1
			break
	print('YES' if b else 'NO')


import math
A = [int(i) for i in input().split()]
t = A[0]
for i in range(t):
	val = [int(i) for i in input().split()]
	if 360 % (180 - val[0]) == 0:
		print('YES')
	else:
		print('NO')


N = int(input())
A = []
for k in range(N):
	P = int(input())
	lados = 360 / (180 - P)
	Aux = int(lados)
	if lados == Aux:
		A = A + ['YES']
	else:
		A = A + ['NO']
for j in range(N):
	print(A[j])


x = int(input())
y = []
for i in range(x):
	y.append(input().split())
for k in y:
	for s in k:
		s = int(s)
	if 360 % (180 - s) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
reg = []
for i in range(3, 10000):
	m = (i - 2) * 180 / i
	if int(m) == m:
		reg.append(int(m))
for i in range(n):
	angle = int(input())
	if angle in reg:
		print('YES')
	else:
		print('NO')


import sys
f = False
for line in sys.stdin:
	if not f:
		f = True
		continue
	a = int(line)
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


cases = int(input())
for case in range(cases):
	ext_angle = int(input())
	int_angle = 180 - ext_angle
	print('YES' if 360 % int_angle == 0 else 'NO')


import sys

def solve(n):
	for j in range(3, 361):
		z = 180 - 360 / j
		if z == n:
			return 'YES'
		elif z > n:
			return 'NO'
	return 'NO'
t = int(input())
for i in range(t):
	n = int(sys.stdin.readline())
	print(solve(n))


def check(u: int) -> str:
	if 360 % (180 - u) == 0:
		return 'YES'
	else:
		return 'NO'
k = int(input())
for _ in range(k):
	print(check(int(input())))


t = int(input())
ans = [60, 90, 119, 150, 170, 175, 179]
for i in range(t):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


def main():
	for i in range(int(input())):
		angle = int(input())
		if 360 % (180 - angle) == 0:
			print('YES')
		else:
			print('NO')
main()


a = []
b = []
for x in range(10000):
	n = x + 3
	a = (n - 2) * 180 / n
	if a % 1 == 0:
		b.append(int(a))
n = int(input())
for x in range(n):
	angle = int(input())
	if angle in b:
		print('YES')
	else:
		print('NO')


def ok(integer):
	if 360 % (180 - integer) == 0:
		return 'YES'
	else:
		return 'NO'
stor = []
sa = input()
for x in range(int(sa)):
	stor.append(ok(int(input())))
for element in stor:
	print(element)


t = int(input())
ans = []
valid_angles = {60, 90, 120}
for _ in range(t):
	angle = int(input())
	ans.append('YES' if 360 % (180 - angle) == 0 else 'NO')
print('\n'.join(ans))


import math

def main():
	for i in range(int(input())):
		s = 360 % (180 - int(input()))
		print('YES' if s == 0 else 'NO')
main()


n = int(input())
for i in range(n):
	line = int(input())
	if 360 / (180 - line) % 2 == 0 or (360 / (180 - line) + 1) % 2 == 0:
		print('YES')
	else:
		print('NO')


def IS():
	return int(input())
T = IS()
for _ in range(T):
	A = IS()
	calc = 360 / (180 - A)
	if int(calc) == calc:
		print('YES')
	else:
		print('NO')


def main():
	test_case = int(input())
	for i in range(test_case):
		n = int(input())
		if 360 % (180 - n) == 0:
			print('YES')
		else:
			print('NO')
main()


from sys import stdin, setrecursionlimit
from collections import deque
input = stdin.readline
setrecursionlimit(int(200000.0))

def getstr():
	return input()[:-1]

def getint():
	return int(input())

def getints():
	return list(map(int, input().split()))

def getint1():
	return list(map(lambda x: int(x) - 1, input().split()))
jn = lambda x, l: x.join(map(str, l))
MOD = 10 ** 9 + 7
(y, n) = ('YES', 'NO')

def solve():
	x = int(input())
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	a = int(input())
	temp = 360 / (180 - a)
	if round(temp) == temp:
		print('YES')
	else:
		print('NO')


t = int(input())
for j in range(t):
	a = int(input())
	check = False
	for i in range(1, 400):
		if 180 - 360 / i == a:
			check = True
			break
	if check:
		print('YES')
	else:
		print('NO')


test = int(input())
while test > 0:
	t = int(input())
	temp = 180 - t
	if 360 % temp == 0 and t < 180:
		print('YES')
	else:
		print('NO')
	test = test - 1


import math
import collections
t = int(input())
for w in range(t):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
n0list = []
for i in range(1, 359):
	if 180 * i % (i + 2) == 0:
		n0list.append(180 * i / (i + 2))
for i in range(n):
	x = int(input())
	if (x in n0list) == True:
		print('YES')
	else:
		print('NO')


def f(x):
	for i in range(361):
		if 180 * i - x * i == 360:
			print('YES')
			break
	else:
		print('NO')
for i in range(int(input())):
	f(int(input()))


for i in range(int(input())):
	z = int(input())
	x = 1
	while x * 180 < z * (x + 2):
		x += 1
	print(['NO', 'YES'][x * 180 == z * (x + 2)])


from fractions import Fraction
for _ in range(int(input())):
	a = int(input())
	if float(2 / (1 - Fraction(a, 180))).is_integer():
		print('YES')
	else:
		print('NO')


y = int(input())
leng = y
m = []
while y > 0:
	x = int(input())
	n = 360 / (180 - x)
	z = int(n)
	if z == n:
		case = 'YES'
	else:
		case = 'NO'
	m.append(case)
	y = y - 1
index = 0
while leng > 0:
	print(m[index])
	leng -= 1
	index += 1


def itsPolygon():
	angle = float(input())
	if 360 % (180 - angle) == 0:
		return 'YES'
	return 'NO'
for i in range(int(input())):
	print(itsPolygon())


import sys, os.path
sys.setrecursionlimit(10 ** 5)

def mod():
	return 1000000007

def ii():
	return int(sys.stdin.readline())

def si():
	return sys.stdin.readline().strip()

def li():
	return list(sys.stdin.readline().strip())

def mii():
	return map(int, sys.stdin.readline().split())

def lii():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve():
	a = ii()
	a = 360 / (180 - a)
	if a == int(a):
		print('YES')
	else:
		print('NO')
for _ in range(ii()):
	solve()


t = int(input())
while t:
	n = int(input())
	if int(360 / (180 - n)) == float(360 / (180 - n)):
		print('YES')
	else:
		print('NO')
	t -= 1


def solve(angle):
	if 360 % (180 - angle) != 0:
		return 'NO'
	else:
		return 'YES'
cases = int(input())
results = list()
for i in range(cases):
	results.append(int(input()))
for res in results:
	print(solve(res))


import math
for _ in range(int(input())):
	a = int(input())
	d = 180 - a
	if math.floor(360 / d) == math.ceil(360 / d):
		print('YES')
	else:
		print('NO')


t = int(input())
out = []
for x in range(t):
	a = int(input())
	val1 = -360 / (a - 180)
	val2 = -360 // (a - 180)
	if val1 == val2 and val1 > 0:
		out.append('YES')
	else:
		out.append('NO')
for p in out:
	print(p)


n = int(input())
s = 0
for i in range(n):
	a = int(input())
	s = round(abs(360 / (a - 180)))
	if a == (s - 2) * 180 / s:
		print('YES')
	else:
		print('NO')


def sides_for_internal_angle(angle):
	if angle >= 180:
		return None
	numerator = 360
	divisor = 180 - angle
	if numerator % divisor != 0:
		return None
	sides = numerator // divisor
	if sides < 3:
		return None
	return sides
t = int(input())
for _ in range(t):
	angle = int(input())
	if sides_for_internal_angle(angle) is not None:
		print('YES')
	else:
		print('NO')


def FancyFence():
	s = int(input())
	for i in range(1, 10001):
		if 180 * i / (i + 2) == float(s):
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	x = FancyFence()
	print(x)


A = [int(180 * (x - 2) / x) for x in range(3, 400) if 180 * (x - 2) / x % 1 == 0]
n = int(input())
for i in range(n):
	line = int(input())
	if line in A:
		print('YES')
	else:
		print('NO')


import math
t = int(input())
for i in range(t):
	a = int(input())
	result = False
	r = 360 % (180 - a)
	result = r == 0
	print('YES' if result else 'NO')


for _ in range(int(input())):
	a = int(input())
	k = 360 / (180 - a)
	l = int(k)
	if k == l:
		print('YES')
	else:
		print('NO')


n = int(input())
angle = []
for i in range(0, n):
	angle.append(int(input()))
maxAngle = max(angle)
a = []
i = 3
m = int((i - 2) / i * 180)
a.append(m)
while m <= maxAngle and m < 179:
	i += 1
	if (i - 2) * 180 % i == 0:
		m = int((i - 2) / i * 180)
		a.append(m)
for x in angle:
	if x in a:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	k = 360 / (180 - int(input()))
	if k.is_integer() == True:
		print('YES')
	else:
		print('NO')


n = int(input())
i = 0
l = []
while i < n:
	x = int(input())
	l.append(x)
	i = i + 1
i = 0
while i < n:
	x = 360 / (180 - l[i])
	y = 360 // (180 - l[i])
	i = i + 1
	if x - y == 0:
		print('YES')
	else:
		print('NO')


import sys
inf = float('inf')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
t = int(input())
while t > 0:
	n = int(input())
	if n == 180:
		print('NO')
		t -= 1
		continue
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	f = 0
	for i in range(3, 10001):
		if n * i == (i - 2) * 180:
			f = 1
			break
	print('YES') if f else print('NO')


n = int(input())
for i in range(n):
	m = int(input())
	i = 3
	while True:
		d = (i - 2) * 180 / i
		if d > m:
			print('NO')
			break
		if d == m:
			print('YES')
			break
		i += 1


for c in range(int(input())):
	print('YES' if not 360 % (180 - int(input())) else 'NO')


a = int(input())
for k in range(a):
	b = int(input())
	c = 360 / (180 - b)
	if c == int(c):
		print('YES')
	else:
		print('NO')


n = int(input())
result = []
for i in range(n):
	degr = int(input())
	if (360 / (180 - degr)).is_integer():
		result.append('YES')
	else:
		result.append('NO')
for i in range(n):
	print(result[i])


t = int(input())
for i in range(t):
	a = int(input())
	test = False
	for j in range(1, 1000):
		if j * a % 180 == 0:
			k = int(j * a / 180)
			if j == 3 + k - 1:
				test = True
	if test == True:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	x = int(input())
	x = 1 / (0.5 - x / 360)
	if x - (x + 9e-09) // 1 > 0.0002:
		print('NO')
	else:
		print('YES')


t = int(input())
a = list()
for i in range(t):
	a.append(int(input()))
for i in range(t):
	j = 1
	while j:
		if 180 * j / (j + 2) == a[i]:
			print('YES')
			break
		elif 180 * (j - 1) / (j + 1) < a[i] < 180 * j / (j + 2):
			print('NO')
			break
		j += 1


t = int(input())
a = [int(input()) for _ in range(t)]
for e in a:
	n = 360 / (180 - e)
	if n.is_integer() and n > 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = int(input())
	d = 360 / (180 - a)
	d = str(d)
	if d[len(d) - 1] == '0':
		print('YES')
	else:
		print('NO')


n = int(input())
i = 0
N = [0] * n
while i < n:
	N[i] = int(input())
	i += 1
i = 0
k = 3
while i < n:
	while 180 * (k - 2) / k < N[i]:
		k += 1
	if 180 * (k - 2) / k == N[i]:
		print('YES')
	else:
		print('NO')
	i += 1
	k = 3


l = lambda : int(input())
t = l()
for i in range(t):
	n = l()
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


import math
from collections import Counter

def get(f):
	return map(f, input().split())

def divides(a, b):
	return a % b == 0

def main():

	def angle(n):
		return 180 * (n - 2) / n
	angles = set()
	for i in range(3, 1000):
		a = angle(i)
		if a == int(a):
			angles.add(int(a))
	n = int(input())
	for i in range(n):
		x = int(input())
		if x in angles:
			print('YES')
		else:
			print('NO')
main()


t = int(input())
r = 0
while r < t:
	i = int(input())
	if 360 % (180 - i) == 0 and 360 / (180 - i) > 2:
		print('YES')
	else:
		print('NO')
	r = r + 1


t = input()
while True:
	try:
		t = int(t)
		if t > 0 and t < 180:
			break
		else:
			t = input()
	except ValueError:
		print()
for i in range(t):
	a = int(input())
	x = -360 / (a - 180)
	remainder = -360 % (a - 180)
	if 0 < a < 180 and remainder == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	t = t - 1
	ele = int(input())
	if 180 - ele <= 0:
		print('NO')
	else:
		x = 180 - ele
		if 360 % x == 0:
			print('YES')
		else:
			print('NO')


import math
a = []
for n in range(3, 500):
	if (n - 2) * 180 % n == 0:
		a.append((n - 2) * 180 // n)
t = int(input())
for _ in range(t):
	b = int(input())
	if b in a:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	a = int(input())
	n = 2 * 180 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')
	t -= 1


t = eval(input())
Case = []
for i in range(t):
	Case.append(eval(input()))
for i in range(t):
	if 360 % (180 - Case[i]) == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	print(['NO', 'YES'][(360 / (180 - int(input()))).is_integer()])


t = int(input())
degrees = [int(input()) for _ in range(t)]
answers = ['YES' if 360 % (180 - a) == 0 else 'NO' for a in degrees]
print(*answers, sep='\n')


n = int(input())
lines = []
for i in range(n):
	lines.append(int(input()))
for i in range(n):
	if 360 // (180 - lines[i]) == 360 / (180 - lines[i]):
		print('YES')
	else:
		print('NO')


i = int(input())
lis = []
for l in range(i):
	x = int(input())
	if 360 % (180 - x) == 0:
		lis.append('YES')
	else:
		lis.append('NO')
for m in lis:
	print(m)


t = int(input())
for i in range(t):
	a = int(input())
	corr = 0
	for k in range(3, 10000):
		ang = (k - 2) * 180 / k
		if ang == a:
			print('YES')
			corr = 1
			break
	if corr == 0:
		print('NO')


test_cases = int(input())
test = test_cases
sides = []
while test_cases > 0:
	sides.append(int(input()))
	test_cases -= 1
for side in sides:
	isPolygon = 'NO'
	for i in range(3, 361):
		test = 180 * (i - 2) / i
		if test == float(side):
			isPolygon = 'YES'
	print(isPolygon)


n = int(input())
for i in range(n):
	num = int(input())
	if num > 30 and (num == 90 or 360 // (180 - num) * (180 - num) == 360):
		print('YES')
	else:
		print('NO')


n = int(input())
l = []
a = 60
p = 3
while a < 179:
	a = (p - 2) * 180
	a /= p
	p += 1
	l.append(a)
for __ in range(n):
	x = int(input())
	if x in l:
		print('YES')
	else:
		print('NO')


p = q = 0
t = int(input())
if t > 0 and t < 180:
	for i in range(t):
		a = int(input())
		if a > 0 and a < 180:
			if 360 % (180 - a) == 0:
				print('YES')
			else:
				print('NO')


def true_angle(a):
	if 360 % (180 - a) == 0:
		return 'YES'
	return 'NO'
t = int(input())
for i in range(t):
	print(true_angle(int(input())))


T = int(input())
C = [60, 90, 108, 120, 135, 140, 144, 150, 156, 160, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 178, 179]
Ans = ''
for t in range(T):
	n = int(input())
	if n in C:
		Ans += 'YES\n'
	else:
		Ans += 'NO\n'
print(Ans, end='')


nCasos = int(input())
resultados = []
for x in range(nCasos):
	l = int(input())
	n = 360 / (180 - l)
	if n % 1 == 0:
		resultados.append('YES')
	else:
		resultados.append('NO')
for z in range(len(resultados)):
	if z != len(resultados) - 1:
		print(resultados[z])
	else:
		print(resultados[z], end='')


t = int(input())
ai = [0] * 10000
for i in range(3, 10000):
	if 180 * (i - 2) % i == 0:
		ai[i - 3] = 180 * (i - 2) // i
for i in range(t):
	a = int(input())
	ans = 0
	for i in range(10000):
		if ai[i] == a:
			ans = 1
	if ans == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
L = [int(input()) for _ in range(t)]
for k in range(t):
	i = 3
	r = 0
	while abs(L[k] - r) > 10 ** (-6) and L[k] >= r:
		r = 180 * (1 - 2 / i)
		i += 1
	if abs(L[k] - r) <= 10 ** (-6):
		print('YES')
	else:
		print('NO')


import math
test = int(input())
i = 0
while i < test:
	rec = int(input())
	ans = 360 / (180 - rec)
	one = math.floor(ans)
	two = math.ceil(ans)
	if one == two:
		print('YES')
	else:
		print('NO')
	i += 1


from sys import stdin
for _ in range(int(stdin.readline().strip())):
	phi = 180 - int(stdin.readline().strip())
	print(('NO', 'YES')[phi <= 120 and 360 % phi == 0])


x = int(input())
i = 0
L = []
k = []
while i < x:
	y = input()
	L.append(y)
	i = i + 1
for i in range(2, 1000):
	angle = round((1 - 2 / i) * 180, 2)
	k.append(angle)
z = 0
while z < x:
	try:
		if k[k.index(int(L[z]))] == int(L[z]):
			print('YES')
	except ValueError:
		print('NO')
	z = z + 1


n = int(input())
for i in range(n):
	angle = int(input())
	if angle < 60:
		print('NO')
	else:
		y = 360 / (180 - angle)
		if int(y) == y:
			print('YES')
		else:
			print('NO')


n = int(input())
answer = ''
for w in range(n):
	x = int(input())
	n = 3
	while 180 * (n - 2) / n < x:
		n += 1
	if 180 * (n - 2) / n == x:
		answer += 'YES\n'
	else:
		answer += 'NO\n'
print(answer)


t1 = int(input())
for i in range(t1):
	a = int(input())
	res = 360 / (180 - a)
	if int(res) == abs(res):
		print('YES')
	else:
		print('NO')


a = int(input())
result = ''
for i in range(0, a):
	p = int(input())
	if 360 % (180 - p) == 0:
		result += 'YES\n'
	else:
		result += 'NO\n'
print(result)


n = int(input())
s = 0
L = []
for i in range(3, 361):
	if 360 % i == 0:
		L.append(180 - 360 // i)
for i in range(n):
	a = int(input())
	if a in L:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	angle = int(input())
	tot = 180 - angle
	if 360 % tot == 0:
		print('YES')
	else:
		print('NO')


ANGLES = set()
for n in range(3, 361):
	angle = (n - 2) * 180 / n
	if angle % 1 == 0:
		ANGLES.add(angle)
n = int(input())
ins = map(int, [input() for _ in range(n)])
for i in ins:
	print('YES' if i in ANGLES else 'NO')


t = int(input())
g = ''
for i in range(t):
	a = int(input())
	if a >= 60:
		n = 360 // (180 - a)
		if (n - 2) * 180 // n == a:
			g += 'YES '
		else:
			g += 'NO '
	elif a < 60:
		g += 'NO '
print('\n'.join(g.split()))


for __ in range(int(input())):
	a = int(input())
	c = 360 / (180 - a)
	if c == int(c):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	angle = int(input())
	ans1 = 360 / (180 - angle)
	ans2 = 360 // (180 - angle)
	if ans1 == ans2:
		print('YES')
	else:
		print('NO')


def zabor(lst):
	z = list()
	for elem in lst:
		if 360 % (180 - elem) == 0:
			z.append('YES')
		else:
			z.append('NO')
	return z
t = int(input())
b = list()
for i in range(t):
	s = int(input())
	b.append(s)
print(*zabor(b), sep='\n')


n = int(input())
lt = []
for i in range(0, n):
	lt.append(int(input()))
for i in range(0, n):
	if 360 % (180 - lt[i]) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
angle = []
result = []
for i in range(n):
	angle.append(int(input()))
for i in range(n):
	result.append('NO')
x = 0
mangle = max(angle)
i = 1
while x < mangle:
	x = (i - 2) * 180 / i
	for j in range(len(angle)):
		if x == angle[j]:
			result[j] = 'YES'
	i += 1
for i in result:
	print(i)


num = int(input())
angle = []
for i in range(num):
	angle.append(int(input()))
for a in angle:
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
for i in range(n):
	a = ii()
	a = 180 - a
	if 360 / a == int(360 / a):
		print('YES')
	else:
		print('NO')


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(int(ri())):
	temp = int(ri())
	ext = 180 - temp
	t = 360 // ext
	if t * ext == 360:
		YES()
	else:
		NO()


def fun(angle):
	i = 3
	total_angle = 180
	given_angle = angle * i
	while total_angle < given_angle:
		total_angle = (i - 2) * 180
		given_angle = angle * i
		i += 1
	if total_angle == given_angle:
		print('YES')
	else:
		print('NO')
T = int(input())
for i in range(T):
	val = int(input())
	fun(val)


N = int(input())
while N > 0:
	angle = int(input())
	if angle < 60:
		print('NO')
	elif 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')
	N -= 1


n = int(input())
k = 0
r = []
for i in range(n):
	k = int(input())
	l = 360 / (180 - k)
	if l.is_integer() == True:
		r.append(1)
	else:
		r.append(0)
for e in range(n):
	if r[e] == 1:
		print('YES')
	else:
		print('NO')


angles = []
for i in range(int(input())):
	angles.append(int(input()))

def checkSides(angle):
	a = 180 - angle
	b = 360
	side = b / a
	if side.is_integer():
		return 'YES'
	else:
		return 'NO'
for angle in angles:
	print(checkSides(angle))


q = int(input())
while q:
	print(['NO', 'YES'][360 % (180 - int(input())) == 0])
	q -= 1


n = int(input())
liste = []
for i in range(n):
	angle = int(input())
	if 360 / (180 - angle) % 1 == 0:
		liste.append('YES')
	else:
		liste.append('NO')
print('\n'.join(liste))


def polygon():
	i = input()
	i = int(i)
	while i:
		angle = input()
		angle = int(angle)
		if angle == 180:
			print('NO')
		elif angle < 180:
			n = 360 / (180 - angle)
			if n.is_integer():
				print('YES')
			else:
				print('NO')
		i -= 1

def main():
	polygon()
main()


t = int(input())
for _ in range(t):
	a = int(input())
	for num_sides in range(3, 3600):
		sum_degrees = 180 * (num_sides - 2)
		if a * num_sides < sum_degrees:
			print('NO')
			break
		if a * num_sides == sum_degrees:
			print('YES')
			break
	else:
		raise Exception('...')


for _ in range(int(input())):
	k = int(input())
	if 2 * k / (180 - k) == 2 * k // (180 - k):
		print('YES')
	else:
		print('NO')


def poligono(angulo):
	es_poligono = 360 % (180 - int(angulo))
	if es_poligono == 0:
		return 'YES'
	elif es_poligono > 0:
		return 'NO'
opciones = int(input())
resultados = []
for i in range(opciones):
	angulo = int(input())
	figura = poligono(angulo)
	resultados.append(figura)
for i in range(len(resultados)):
	print(resultados[i])


from math import floor
t = int(input())
angles = [int(input()) for i in range(t)]
for i in angles:
	if 360 / (180 - i) == floor(360 / (180 - i)):
		print('YES')
	else:
		print('NO')


def main():
	tests = int(input())
	for i in range(tests):
		inAngle = int(input())
		n = 2 / (1 - inAngle / 180)
		n = round(n, 2)
		if n - int(n) == 0:
			print('YES')
		else:
			print('NO')
	return ()
main()


i = 1
m = int(input())
n = 3
list = []
while n <= 360:
	if 180 * (n - 2) % n == 0:
		x = 180 * (n - 2) / n
		list.append(x)
	n += 1
angle = []
while i <= m:
	a = int(input())
	angle.append(a)
	i += 1
for let in angle:
	if let in list:
		print('YES')
	else:
		print('NO')


l = [float(input()) for i in range(int(input()))]

def verify(x):
	if 360 % (180 - x) == 0:
		print('YES')
	else:
		print('NO')
for i in l:
	verify(i)


t = int(input())
for _ in range(t):
	a = int(input())
	if a < 60 or 360 % (180 - a) != 0:
		print('NO')
	else:
		print('YES')


t = int(input())
r = []
for i in range(t):
	a = int(input())
	n = 360 / (180 - a)
	if a < 60 or a > 180:
		r.append('NO')
	elif a >= 60 and a <= 180 and (n == int(n)):
		r.append('YES')
	else:
		r.append('NO')
for i in range(t):
	print(r[i])


import math
t = int(input())
for i in range(t):
	a = int(input())
	for i in range(3, 10000000):
		if (i - 2) * 180 / i > a:
			print('NO')
			break
		if a * i / 180 + 2 == math.ceil(a * i / 180 + 2):
			print('YES')
			break


n = int(input())
i = 0
while i < n:
	angle = int(input())
	if 360 % (180 - angle) == 0 and 360 / (180 - angle) >= 3:
		print('YES')
	else:
		print('NO')
	i += 1


for i in range(int(input())):
	print(['NO', 'YES'][360 % (180 - int(input())) < 1])


tests = int(input())
i = 1
while i <= tests:
	angle = int(input())
	if 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')
	i += 1


for u in range(int(input())):
	n = int(input())
	x = 180 - n
	if x >= 1 and x <= 180:
		if 360 % x == 0:
			print('YES')
		else:
			print('NO')


n = int(input())
result = []
while n > 0:
	entrada = int(input())
	if 360 % (180 - entrada) == 0:
		result.append('YES')
	else:
		result.append('NO')
	n -= 1
for a in result:
	print(a)


def main():
	n = int(input())
	for _ in range(n):
		A = int(input())
		if 360 % (180 - A):
			print('NO')
		else:
			print('YES')
main()


t = int(input())
angles = []
for _ in range(t):
	angles.append(int(input()))
for ans in angles:
	n = 2 / ((180 - ans) / 180)
	if n.is_integer():
		print('YES')
	else:
		print('NO')


t = int(input())
angles = list()
answer = list()
for i in range(t):
	angles.append(float(input()))
for angle in angles:
	for i in range(1, 361):
		if angle == 180 * (i - 2) / i:
			answer.append('YES')
			break
		elif angle < 180 * (i - 2) / i:
			answer.append('NO')
			break
for a in answer:
	print(a)


n = int(input())
sudut = []
for i in range(1, 500):
	a = 180 * i / (i + 2)
	sudut.append(a)
for i in range(n):
	b = int(input())
	if b in sudut:
		print('YES')
	else:
		print('NO')


import bisect, math

def foo(n):
	return 'YES' if 360 % (180 - n) == 0 else 'NO'
t = int(input())
for _ in range(t):
	n = int(input())
	print(foo(n))


def chk(n):
	for i in range(3, 2 ** 32 - 1, 1):
		x = (i - 2) * 180 / i
		if n == x:
			f = 'YES'
			break
		if x > n:
			f = 'NO'
			break
		else:
			continue
	return f
a = []
n = int(input())
for i in range(n):
	a.append(int(input()))
for i in a:
	print(chk(i))


for _ in ' ' * int(input()):
	print('NO' if 360 % (180 - int(input())) else 'YES')


from sys import stdin, stdout
import math
from fractions import gcd

def sin():
	return stdin.readline().rstrip()

def listInput():
	return list(map(int, sin().split()))

def printBS(li):
	if not li:
		return
	for i in range(len(li) - 1):
		stdout.write('%d ' % li[i])
	stdout.write('%d\n' % li[-1])
t = int(sin())
for _ in range(t):
	a = int(sin())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
angles = [int(input()) for i in range(n)]
for angle in angles:
	sides = int(360 / (180 - angle))
	print('YES') if angle == 180 - 360 / sides else print('NO')


t = int(input())
angles = set()
for i in range(3, 361):
	corner = 180 - 360 / i
	if corner % 1.0 < 1e-09:
		angles.add(int(corner))
for i in range(t):
	n = int(input())
	if n in angles:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	a = int(input())
	for n in range(3, 1000):
		if (n - 2) * 180 / n == a:
			print('YES')
			break
	else:
		print('NO')


for _ in [0] * int(input()):
	a = input()
	for i in range(3, 400 + 1):
		j = (i - 2) * 180 / i
		if j == float(a):
			print('YES')
			break
	if j > float(a):
		print('NO')


T = int(input())
results = []
for case in range(T):
	angle = int(input())
	result = 'NO'
	if 360 % (180 - angle) == 0:
		result = 'YES'
	results.append(result)
for result in results:
	print(result)


def makePolygon(a):
	n = 360 / (180 - a)
	if n == int(n):
		print('YES')
	else:
		print('NO')
t = int(input())
while t:
	a = int(input())
	makePolygon(a)
	t = t - 1


__author__ = 'curiousfool'
n = int(input())
for i in range(0, n):
	angle = int(input())
	x = 360 / (180 - angle)
	if x == 360 // (180 - angle):
		print('YES')
	else:
		print('NO')


y = int(input())
for i in range(y):
	c = int(input())
	n = 360 / (180 - c)
	if n == int(n):
		print('YES')
	else:
		print('NO')


n = int(input())
while n > 0:
	n2 = 3
	x = int(input())
	while 1:
		d = 180 * (n2 - 2) / n2
		if d == x:
			print('YES')
			break
		elif d > x:
			print('NO')
			break
		n2 = n2 + 1
	n = n - 1


a = 1
n = 3
d = []
while a <= 179:
	a = (n - 2) * 180 / n
	d.append(a)
	n += 1
T = int(input())
for i in range(T):
	k = int(input())
	if k in d:
		print('YES')
	else:
		print('NO')


def angle(a):
	if int(a) < 60:
		return False
	elif 360 / (180 - int(a)) % 1 == 0:
		return True
	else:
		return False
n = input()
n = int(n)
ans = []
for i in range(n):
	a = input()
	if angle(a):
		ans.append('YES')
	else:
		ans.append('NO')
for m in range(n):
	print(ans[m])


def f():
	t = int(input())
	for i in range(t):
		angle = int(input())
		if 360 % (180 - angle) == 0:
			print('YES')
		else:
			print('NO')
f()


t = int(input())
for _ in range(t):
	x = int(input())
	k = 180 - x
	if 360 % k == 0:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	degree = int(input())
	if (360 / (180 - degree)).is_integer():
		print('YES')
	else:
		print('NO')


__author__ = 'myduomilia'
n = int(input())
arr = []
for i in range(3, 361):
	arr.append((i - 2) * 180 / i)
for i in range(n):
	val = int(input())
	if val in arr:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t, 1):
	a = int(input())
	x = 180 - a
	num = 360 / x
	nu = int(num)
	if nu == num:
		print('YES')
	else:
		print('NO')


n = int(input())
out = ''
for i in range(n):
	out += ['NO\n', 'YES\n'][360 / (180 - int(input())) % 1 == 0]
print(out[:-1])


from typing import List

def parse_input() -> List[int]:
	n = int(input())
	return [int(input()) for x in range(n)]

def solve(angle: int) -> str:
	if 360 % (180 - angle) == 0:
		return 'YES'
	return 'NO'
angles = parse_input()
for angle in angles:
	print(solve(angle))


t = int(input())
for i in range(t):
	angle = int(input())
	flag = 0
	for j in range(3, 361):
		a = angle * j
		b = (j - 2) * 180
		if a == b:
			flag = 1
			break
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
l = []
for i in range(t):
	s = int(input())
	l.append(s)
for j in l:
	for k in range(1, 361):
		if 360 / (180 - j) == float(k):
			print('YES')
			break
		elif k == 360:
			print('NO')


times = int(input())
answers = []
for time in range(times):
	a = int(input())
	if 360 % (180 - a) == 0:
		answers.append('YES')
	else:
		answers.append('NO')
for answer in answers:
	print(answer)


testcase_num = int(input())
for i in range(testcase_num):
	angle = int(input())
	if angle != 180 and 360 % (180 - angle) == 0:
		print('YES')
	else:
		print('NO')


import sys
pos = [False for i in range(180)]
for i in range(360):
	n = i + 3
	deg = (n - 2) * 180 / n
	if int(deg) == deg:
		pos[int(deg)] = True
n = int(sys.stdin.readline().rstrip('\n'))
for i in range(n):
	q = int(sys.stdin.readline().rstrip('\n'))
	if pos[q]:
		sys.stdout.write('YES\n')
	else:
		sys.stdout.write('NO\n')


n = int(input())
for i in range(n):
	alpha = int(input())
	n1 = 360 // (180 - alpha)
	n2 = 360 / (180 - alpha)
	if n1 == n2:
		print('YES')
	else:
		print('NO')


def isPowerOfTwo(x):
	return x and (not x & x - 1)

def ncr(e):
	return e * (e - 1) // 2
lst = []
for i in range(3, 200):
	x = (i - 2) * 180 // i
	lst.append(x)
t = int(input())
for i in range(t):
	n = int(input())
	if 360 % (180 - n) == 0:
		print('YES')
	else:
		print('NO')


n = int(input())
lst = [180 * (x - 2) / x for x in range(3, 361)]
for i in range(n):
	a = int(input())
	if a in lst:
		print('YES')
	else:
		print('NO')


import math
n = int(input())
for i in range(n):
	alpha = int(input())
	flag = 0
	for n in range(2, 1000):
		if alpha * n == 180 * (n - 2):
			print('YES')
			flag = 1
			break
	if not flag:
		print('NO')


n = int(input())
d = 0
for i in range(n):
	p = int(input())
	for j in range(3, 100000):
		if p == 180 * (j - 2) / j:
			d = 1
			print('YES')
			break
		if p < 180 * (j - 2) / j:
			print('NO')
			break


def isPoly(a):
	if 360 / (180 - a) == 360 // (180 - a):
		return True
	else:
		return False
t = int(input())
for i in range(t):
	x = int(input())
	if isPoly(x):
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	n = float(input())
	if n >= 180:
		print('NO')
	else:
		s = 3
		while (s - 2) * 180 / s < n:
			s += 1
		if (s - 2) * 180 / s == n:
			print('YES')
		else:
			print('NO')


n = int(input())
angles = []
for i in range(n):
	angles.append(int(input()))
for ang in angles:
	print(['NO', 'YES'][360 % (180 - ang) == 0])


import math
t = int(input())
while t:
	t -= 1
	a = int(input())
	n = 360 / (180 - a)
	if n - math.ceil(n) == 0:
		print('YES')
	else:
		print('NO')


n = int(input().strip())
ll = []
for i in range(n):
	k = int(input().strip())
	l = 180
	j = 1
	while True:
		if j * 180 / k == j + 2:
			ll.append('YES')
			break
		elif j * 180 / k > j + 2:
			ll.append('NO')
			break
		j += 1
print('\n'.join(ll))


loop = int(input())
for i in range(loop):
	answer = 'NO'
	angle = int(input())
	truth = True
	k = 3
	while truth == True:
		check = angle * k
		checkTwo = (k - 2) * 180
		if check > checkTwo:
			k += 1
		if check == checkTwo:
			answer = 'YES'
			truth = False
		if check < checkTwo:
			truth = False
	print(answer)


n = int(input())
for i in range(0, n):
	t = float(input())
	c = 0
	for i in range(3, 1000):
		if t == 180 * (i - 2) / i:
			c = 1
	if c == 1:
		print('YES')
	if c == 0:
		print('NO')


def main():
	t = int(input())
	angles = {180 - 360 // i for i in range(3, 361) if 360 % i == 0}
	for _ in range(t):
		print('YES' if int(input()) in angles else 'NO')
main()


def solve(x):
	return 360 % (180 - x) == 0

def tf_to_yn(tf):
	return 'YES' if tf else 'NO'

def main():
	t = int(input())
	for _ in range(t):
		x = int(input())
		result = solve(x)
		print(tf_to_yn(result))
main()


n = int(input())
b = []
for i in range(0, n):
	a = int(input())
	b.append(a)
for j in range(0, n):
	x = b[j]
	for k in range(3, 1000):
		if (k - 2) * 180 / k == float(x):
			print('YES')
			break
		elif (k - 2) * 180 / k > float(x):
			print('NO')
			break


numberTest = int(input())
test = 0

def polygonCheck(angle):
	x = 360 / (180 - angle)
	if x % 1 == 0:
		print('YES')
	else:
		print('NO')
while test != numberTest:
	angle = int(input())
	polygonCheck(angle)
	test += 1


for _ in range(int(input())):
	print(['NO', 'YES'][(360 / (180 - int(input()))).is_integer()])


n = int(input())
ans = []
for i in range(n):
	a = int(input())
	if 360 % (180 - a) == 0:
		ans.append('YES')
	else:
		ans.append('NO')
print(*ans, sep='\n')


list = []
num = int(input())
i = 0
while i < num:
	line = int(input())
	result = 360 / (180 - line)
	if float(result).is_integer():
		list.append('YES')
	else:
		list.append('NO')
	i += 1
for item in list:
	print(item)


t = int(input())
for i in range(t):
	b = False
	a = int(input())
	for j in range(2, 10000):
		if (j - 2) * 180 / j == a:
			print('YES')
			b = True
			break
	if b == False:
		print('NO')


n = int(input())
for i in range(n):
	x = int(input())
	if int(360 / (180 - x)) / float(360 / (180 - x)) == 1.0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = int(input())
	print(['NO', 'YES'][360 / (180 - a) == 360 // (180 - a)])


t = int(input())
l = []
for i in range(1, 10000):
	if i * 180 % (i + 2) == 0:
		l.append(i * 180 // (i + 2))
for i in range(t):
	a = int(input())
	if a in l:
		print('YES')
	else:
		print('NO')


angle = {3: 60, 4: 90, 5: 108, 6: 120, 8: 135, 9: 140, 10: 144, 12: 150, 15: 156, 18: 160, 20: 162, 24: 165, 30: 168, 36: 170, 40: 171, 45: 172, 60: 174, 72: 175, 90: 176, 120: 177, 180: 178, 360: 179}
t = int(input())
for test in range(t):
	a = int(input())
	if a in angle.values():
		print('YES')
	else:
		print('NO')


import sys
input = sys.stdin.readline
for i in range(int(input())):
	a = int(input())
	if 360 % (180 - a) == 0:
		print('YES')
	else:
		print('NO')