#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, m;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    ((360 % (180 - m)) == 0) ? cout << "YES\n" : cout << "NO\n";
  }
  return 0;
}
