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