#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int t, x;
void Solve() {
  cin >> x;
  if (360 % (180 - x) == 0)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    Solve();
  }
  return 0;
}
