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