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