#include <bits/stdc++.h>
using namespace std;
int main() {
  int angle, t;
  cin >> t;
  while (t--) {
    cin >> angle;
    int i = 3;
    while (true) {
      int a;
      a = 180 - (360 / i);
      if (a == angle && 360 % i == 0) {
        cout << "YES" << '\n';
        break;
      } else if (a > angle) {
        cout << "NO" << '\n';
        break;
      }
      i++;
    }
  }
}
