#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main() {
  cin >> a;
  for (int i = 1; i <= a; i++, c = 0) {
    cin >> b;
    for (int h = 3; h <= 100010; h++)
      if (b * h == (h - 2) * 180) {
        cout << "YES\n", c++;
        break;
      }
    if (c == 0) cout << "NO\n";
  }
}
