#include <bits/stdc++.h>
using namespace std;
map<double, bool> m;
void gen() {
  m.clear();
  double n = 0, i = 3, k = 1;
  while (n < 179) {
    n = (k * 180) / i;
    m[n] = true;
    k++;
    i++;
  }
}
int main() {
  int tc;
  double n;
  gen();
  while (cin >> tc) {
    while (tc--) {
      cin >> n;
      if (m[n]) {
        cout << "YES\n";
      } else
        cout << "NO\n";
    }
  }
  return 0;
}
