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