#include <bits/stdc++.h>
using namespace std;
int find_() {
  int a, ang, n = 1;
  cin >> a;
  while (1) {
    if (360 % n == 0) ang = 180 - (360 / n);
    if (a == ang) {
      cout << "YES" << endl;
      return 0;
    }
    if (a < ang) {
      cout << "NO" << endl;
      return 0;
    }
    n++;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) find_();
}
