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