#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932238460;
bool arr[361];
void angles() {
  for (int i = 3; i < 361; i++)
    if ((i - 2) * 180 % i == 0) {
      arr[(i - 2) * 180 / i] = true;
    }
}
int main() {
  int t;
  cin >> t;
  angles();
  while (t--) {
    int k;
    cin >> k;
    if (arr[k])
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
