#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<ll, ll>;
ostream& operator<<(ostream& os, const ii& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
const int MAX{2000010};
const ll oo{1LL << 62};
const int MOD{1000000007};
set<int> regular_polygon_angles;
void precomp() {
  for (int(n) = (3); (n) <= (360); (n)++) {
    auto sum = 180 * (n - 2);
    auto m = sum / n;
    if (0 < m and m < 180) {
      if (m * n == sum) regular_polygon_angles.insert(m);
    } else
      break;
  }
}
void solve(int a) {
  cout << (regular_polygon_angles.count(a) ? "YES" : "NO") << endl;
}
int main() {
  ios::sync_with_stdio(false);
  precomp();
  int T;
  cin >> T;
  for (int(i) = 0; (i) < T; (i)++) {
    int a;
    cin >> a;
    solve(a);
  }
  return 0;
}
