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.

import java.io.*;
import java.util.Arrays;
import java.util.InputMismatchException;

public class CF_A270 {
    private InputReader in;
    private PrintWriter out;
    private StringBuilder sb;
    private boolean onlineJudge = System.getProperty("ONLINE_JUDGE") != null;

    private void init() throws Exception {
        in = new InputReader(onlineJudge ? System.in : new FileInputStream(new File("in.txt")));
        out = new PrintWriter(System.out);
        sb = new StringBuilder();
    }

    private void solve() throws Exception {
        int T = in.nextInt();
        for(int tc = 1; tc <= T; tc++) {
            double x = in.nextDouble();
            double n = 360.0 / (180.0 - x);
            if (n % 1 == 0) sb.append("YES");
            else sb.append("NO");
            sb.append("\n");
        }
    }

    private CF_A270() throws Exception {
        long s = System.currentTimeMillis();
        init();
        solve();
        if (!onlineJudge)
            sb.append(sb.charAt(sb.length() - 1) == '\n' ? "" : '\n').append("[OK in : ").append(System.currentTimeMillis() - s).append(" ms]");
        out.print(sb);
        out.close();
    }

    public static void main(String args[]) throws Exception {
        new CF_A270();
    }

    class InputReader {
        private int lenbuf = 0, ptrbuf = 0;
        private InputStream in;
        private byte[] inbuf = new byte[1024];

        InputReader(InputStream in) {
            this.in = in;
        }

        private int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = in.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        char nextChar() {
            return (char) skip();
        }

        String next() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        String nextLine() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b) && b != ' ')) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        char[] nextCharArray(int n) {
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while (p < n && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        char[][] nextCharMatrix(int n, int m) {
            char[][] map = new char[n][];
            for (int i = 0; i < n; i++) map[i] = nextCharArray(m);
            return map;
        }

        int[][] nextIntMatrix(int n, int m) {
            int[][] map = new int[n][];
            for (int i = 0; i < n; i++) map[i] = nextIntArray(m);
            return map;
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }
    }
}
