#include <bits/stdc++.h>
int main() {
  float a[200], c;
  int n, i;
  float d, x, b;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%f", &a[i]);
  }
  for (i = 0; i < n; i++) {
    d = 180 - a[i];
    x = 360 / d;
    if (ceil(x) - x == 0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
