#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  float d;
  float t;
  cin >> n;
  while (n--) {
    cin >> d;
    t = 360 / (180 - d);
    cout << (t == (int)t ? "YES" : "NO");
    cout << endl;
  }
}
