#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, x;
    cin >> a;
    if (!fmod(360, 180 - a))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
