#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
struct pt {
double x, y;
pt(double x, double y) : x(x), y(y) {}
};
void rotate(pt &p, double angle) {
double cosA = cos(angle), sinA = sin(angle);
p = pt(p.x*cosA-p.y*sinA , p.x*sinA+p.y*cosA);
}
bool eq(double a, double b) {
return fabs(a-b) < 1e-9;
}
int main() {
int t; cin >> t;
for(int i = 0; i < t; i++) {
int a; cin >> a;
double angle = (180-a)/180.*acos(-1);
pt v(1,0);
bool ok = false, r = false;
for(int j = 0; j < 360; j++) {
rotate(v, angle);
if(eq(v.x,1) && eq(v.y,0)) {
ok = true;
break;
}
if(v.y < 0) {
r = true;
}
if(r && v.y > 0) {
break;
}
}
cout << (ok?"YES":"NO") << endl;
}
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNtYXRoPgojaW5jbHVkZTxjc3RkaW8+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IHB0IHsKICAgIGRvdWJsZSB4LCB5OwoJcHQoZG91YmxlIHgsIGRvdWJsZSB5KSA6IHgoeCksIHkoeSkge30KfTsKCnZvaWQgcm90YXRlKHB0ICZwLCBkb3VibGUgYW5nbGUpIHsKCWRvdWJsZSBjb3NBID0gY29zKGFuZ2xlKSwgc2luQSA9IHNpbihhbmdsZSk7CglwID0gcHQocC54KmNvc0EtcC55KnNpbkEgLCBwLngqc2luQStwLnkqY29zQSk7Cn0KCmJvb2wgZXEoZG91YmxlIGEsIGRvdWJsZSBiKSB7CglyZXR1cm4gZmFicyhhLWIpIDwgMWUtOTsgCn0KCmludCBtYWluKCkgewkKCWludCB0OyBjaW4gPj4gdDsKCWZvcihpbnQgaSA9IDA7IGkgPCB0OyBpKyspIHsKCQlpbnQgYTsgY2luID4+IGE7CgkJZG91YmxlIGFuZ2xlID0gKDE4MC1hKS8xODAuKmFjb3MoLTEpOwoJCXB0IHYoMSwwKTsKCQlib29sIG9rID0gZmFsc2UsIHIgPSBmYWxzZTsKCQlm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