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