#include <bits/stdc++.h>
using namespace std;
long long __gcd(long long a, long long b) {
  long long c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}
void doit() {
  long long n;
  cin >> n;
  if (360 % (180 - n) == 0) {
    cout << "YES"
         << "\n";
    return;
  }
  cout << "NO"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tc;
  cin >> tc;
  for (int i = 1; i <= tc; i++) {
    doit();
  }
}
