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