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