#include <bits/stdc++.h>
using namespace std;
void Ans(int n) {
  int i = 0, j = 0;
  for (i = 3; i < 180; i++) {
    if (((180 - (360 / i)) - n == 0 && 360 % i == 0) || n == 179 || n == 178) {
      j++;
      break;
    } else if ((180 - (360 / i)) - n > 0) {
      break;
    }
  }
  if (j == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  int n, i = 0, j = 0, k = 0, a = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    Ans(a);
  }
  return 0;
}
