#include<iostream>
#include<cstdio>
using namespace std;
int main() {
int t; cin >> t;
for(int i = 0; i < t; i++) {
int a; cin >> a;
cout << (360 % (180-a) == 0 ? "YES" : "NO") << endl;
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNzdGRpbz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsgICAgCglpbnQgdDsgY2luID4+IHQ7Cglmb3IoaW50IGkgPSAwOyBpIDwgdDsgaSsrKSB7CgkJaW50IGE7IGNpbiA+PiBhOwoJCWNvdXQgPDwgKDM2MCAlICgxODAtYSkgPT0gMCA/ICJZRVMiIDogIk5PIikgPDwgZW5kbDsKCX0KfQo=