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