#include <bits/stdc++.h>
using namespace std;
long long i, j;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, caseno = 0;
  cin >> t;
  while (t--) {
    long long a;
    cin >> a;
    if (360 % (180 - a) == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
