#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    int i = 3;
    double a;
    cin >> a;
    bool flag = 0;
    while (1) {
      double sum = 180 * (i - 2);
      double angle = sum / i;
      if (angle == a) {
        flag = 1;
        break;
      }
      if (angle > a) break;
      i++;
    }
    flag == 1 ? cout << "YES" : cout << "NO";
    cout << endl;
  }
}
