#include <bits/stdc++.h>
using namespace std;
ifstream in("input.txt");
ofstream out("output.txt");
int const nrmax = 1e9;
int v[20];
int main() {
  long long n, k, i;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (i = 1; i <= n; ++i) {
    long long x, ok = 0;
    cin >> x;
    x -= 180;
    x *= -1;
    if (360 % x == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  in.close();
  out.close();
  return 0;
}
