#include <bits/stdc++.h>
using namespace std;
using namespace std::placeholders;
bool compare(int a, int b) { return a > b; }
int main() {
  int t;
  int angle;
  int n;
  cin >> t;
  while (t--) {
    cin >> angle;
    n = 360 % (180 - angle);
    if (n)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
