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