Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.

He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.

Will the robot be able to build the fence Emuskald wants? In other words, is there a regular polygon which angles are equal to a?

Input

The first line of input contains an integer t (0 < t < 180) — the number of tests. Each of the following t lines contains a single integer a (0 < a < 180) — the angle the robot can make corners at measured in degrees.

Output

For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.

Examples

Input

3
30
60
90


Output

NO
YES
YES

Note

In the first test case, it is impossible to build the fence, since there is no regular polygon with angle <image>.

In the second test case, the fence is a regular triangle, and in the last test case — a square.
#include <bits/stdc++.h>
using namespace std;
long long int l1[200005], l2[100005], vis[100005], s = 0, m;
long long int dx[] = {1, 0, -1, 0};
long long int dy[] = {0, -1, 0, 1};
char s2[100005];
int tree[100005 * 4];
void STB(int at, int L, int R) {
  if (L == R) {
    tree[at] = (s2[L - 1] - '0');
    return;
  }
  int mid = (L + R) / 2;
  STB(2 * at, L, mid);
  STB(2 * at + 1, mid + 1, R);
}
void update(int at, int L, int R, int pos1, int pos2) {
  if (L > pos2 || R < pos1) return;
  if (L >= pos1 && R <= pos2) {
    tree[at] ^= 1;
    return;
  }
  int mid = (L + R) >> 1;
  update((at << 1), L, mid, pos1, pos2);
  update((at << 1) + 1, mid + 1, R, pos1, pos2);
}
int query(int at, int L, int R, int l) {
  if (L == R) return tree[at];
  if (L > l && l > R) return 0;
  int mid = (L + R) >> 1;
  if (l <= mid)
    return tree[at] ^ query((at << 1), L, mid, l);
  else
    return tree[at] ^ query((at << 1) + 1, mid + 1, R, l);
}
bool revp(const pair<long long int, long long int>& a,
          const pair<long long int, long long int>& b) {
  if (a.first != b.first)
    return a.first > b.first;
  else
    return a.second < b.second;
}
bool revp2(const pair<long long int, long long int>& a,
           const pair<long long int, long long int>& b) {
  return a.second < b.second;
}
long long int ones(long long int n) {
  long long int s = 0;
  while (n > 0) {
    if (n & 1) s++;
    n = n >> 1;
  }
  return s;
}
int main() {
  long long int t, i, q, n, c, m, k = 0, l, cases = 0, d, p, nl, np, a, e = 1,
                                  b, x2 = -1, x1 = 1000000005, x3 = 0, x4 = 0,
                                  x5 = 0, x6 = 0, x7 = 0, x8 = 0;
  double x10, x14, x15, x16, x17, x18;
  char x11, y1, y2, y3, y4;
  int x12 = 0;
  string s3, s4, s5, s6, s7;
  queue<long long int> q2;
  vector<long long int> vp;
  map<char, long long int> mp;
  map<char, long long int> mp2;
  cin >> t;
  while (t--) {
    cin >> a;
    x10 = 360.0 / (180.0 - a);
    if (x10 == (int)x10)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
