#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<float> a(t);
  for (int i = 0; i < t; i++) cin >> a[i];
  vector<float> n;
  for (int i = 3; i < 361; i++) n.push_back((float(i) - 2) * 180 / float(i));
  for (int i = 0; i < t; i++) {
    bool exist = false;
    for (int j = 0; j < n.size(); j++) {
      if (n[j] == a[i]) {
        exist = true;
        break;
      }
    }
    if (exist)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
