#include <bits/stdc++.h>
using namespace std;
int arr[1000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (t >= 60 && (360 % (180 - t)) == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
