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