#include <bits/stdc++.h>
using namespace std;
void makePolygon(float a) {
  float n = 360 / (180 - a);
  if (n == (int)n)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    float a;
    cin >> a;
    makePolygon(a);
  }
  return 0;
}
