#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int tt = 1;
  cin >> tt;
  for (int tc = 1; tc <= tt; tc++) {
    int a;
    cin >> a;
    if (360 % (180 - a))
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
