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