#include <bits/stdc++.h>
using namespace std;
ifstream fi("test2.inp");
long long n, a, k = 3;
long long mode = 0;
float goc = 0;
float process(long long k) {
  float tmp;
  tmp = 180 - (float)360 / k;
  return tmp;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a < 3)
      cout << "NO" << endl;
    else {
      while (goc < a) {
        mode = 0;
        goc = process(k);
        if (goc == a) {
          k = 3;
          mode = 1;
          goc = 0;
          cout << "YES" << endl;
          break;
        } else {
          k++;
        }
      }
      if (mode == 0) {
        k = 3;
        goc = 0;
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
