#include <bits/stdc++.h>
using namespace std;
void file() { freopen("in.txt", "r", stdin); }
int main() {
  int n;
  scanf("%d", &n);
  int angle;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &angle);
    if (360 % (180 - angle) == 0) {
      puts("YES");
    } else
      puts("NO");
  }
  return 0;
}
