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