#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long int mark[N];
long long int t, n;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL), cerr << "";
  cin >> n;
  for (int i = 3; i < 1000; i++) {
    mark[(i - 2) * 180 / i] = 1;
  }
  mark[999] = 1;
  while (n--) {
    int a;
    cin >> a;
    (360 % (180 - a) != 0 ? cout << "NO\n" : cout << "YES\n");
  }
}
