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