#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long a;
    cin >> a;
    cout << (360 % (180 - a) == 0 ? "YES" : "NO") << endl;
  }
  return 0;
}
