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