#include <bits/stdc++.h>
using namespace std;
bool isPolygon(int x) {
  int n = 360 / (180 - x);
  if ((n - 2) * 180 / n == x) return true;
  return false;
}
int main() {
  int n;
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    if (isPolygon(x))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
