#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int a;
    cin >> a;
    int j = 3;
    int szog = (j - 2) * 180 / j;
    while (szog < a) {
      j++;
      if ((j - 2) * 180 % j == 0) {
        szog = (j - 2) * 180 / j;
      }
    }
    if (szog == a) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
