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