#include <bits/stdc++.h>
using namespace std;
int i, j, k;
int main() {
  int t;
  while (cin >> t) {
    for (i = 0; i < t; i++) {
      int a;
      cin >> a;
      int n1 = 360 / (180 - a);
      double n2 = 360 / (double)(180 - a);
      if (n2 - n1 > 0) {
        cout << "NO" << endl;
      } else
        cout << "YES" << endl;
    }
  }
  return 0;
}
