#include <bits/stdc++.h>
int main() {
  int n, i, a;
  double b;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    b = 360.00 / (180.00 - (double)a);
    if (b > 2 && b == floor(b))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
