#include <bits/stdc++.h>
using namespace std;
int main() {
  double t, n, i;
  double x, f, c;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> n;
    x = 360 / (180 - n);
    f = floor(x);
    c = ceil(x);
    if (f == c) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
