#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a;
    cin >> a;
    double x = 360 / (180 - (double)a);
    int y = 360 / (180 - a);
    if (x == (double)y)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
