#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a;
    cin >> a;
    if (a == 0 || a == 180)
      cout << "NO"
           << "\n";
    else {
      long long n = 360 / (180 - a);
      if (a == (180 * (n - 2)) / n)
        cout << "YES"
             << "\n";
      else
        cout << "NO"
             << "\n";
    }
  }
  return;
}
int main() {
  solve();
  return 0;
}
