#include <bits/stdc++.h>
using namespace std;
bool fu(int A) {
  int tmp;
  for (int i = 3;; i++) {
    tmp = 180 - (360 / i);
    if (tmp > A) break;
    if (360 % i) continue;
    if (tmp == A) return true;
  }
  return false;
}
int main() {
  int T, A;
  cin >> T;
  while (T--) {
    cin >> A;
    if (fu(A))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
