#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;
	}
}
