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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author  Roman Dzhadan
 * @Team    VNTU [Noobs v3.0] - I.Murzak, R.Dzhadan, V.Khruschak
 * @E-Mail  dflash36@gmail.com
 * @Skype   ronex36
 */
public class Main {
    
    public static final String     TYPE              =   IOSystem.STANDART;
    public static final long       TIME_LIMIT        =   2;
    public static final long       MEMORY_LIMIT      =   256 * (1L << 20);
    public static final String     INPUT_FILE_NAME   =   "domino.in";
    public static final String     OUTPUT_FILE_NAME  =   "domino.out";
    public static final boolean    ONLINE_JUDGE      =   System.getProperty("ONLINE_JUDGE") != null;
    
    public static void main(String[] args) throws FileNotFoundException {
        IOSystem IO = (TYPE.equals(IOSystem.STANDART) ? new IOSystem() : new IOSystem(INPUT_FILE_NAME, OUTPUT_FILE_NAME));
        new Thread(null, new Task(IO), "", MEMORY_LIMIT).start();
    }
}

class Task implements Runnable {
//------------------------------------------------------  SOLUTION  -----------------------------------------------------------//   

    public void solve() throws IOException {
        int t = in.readInt();
        int[]data = in.readIntArray(t);
        for (int i = 0; i < data.length; i++) {
            if (data[i] >= 60 && data[i] < 180 && 360 % (180 - data[i]) == 0) out.println("YES");
            else out.println("NO");
        }
    }
    
//-----------------------------------------------------------------------------------------------------------------------------//
    public void run() {
        try {
            long startTime = System.currentTimeMillis();
            solve();
            close();
            long endTime = System.currentTimeMillis();
            long totalMemory = Runtime.getRuntime().totalMemory();
            long freeMemory = Runtime.getRuntime().freeMemory();
            System.err.printf("Time = %.3f ms\n", (endTime - startTime) / 1000.0);
            System.err.printf("Memory = %.3f MB\n", (totalMemory - freeMemory) / (double)(1L << 20));
        }
        catch (Throwable e) {e.printStackTrace(System.err);System.exit(-1);}
    }
    public PrintWriter out;
    public IOSystem in;
    public Task(IOSystem io) {out = io.out; this.in = io;}
    public void close() throws IOException {in.in.close(); out.close();}
    public void debug(Object... o) {if (!Main.ONLINE_JUDGE) {System.err.println(Arrays.deepToString(o));}}
}

class IOSystem {
    public static final String FILE = "file";
    public static final String STANDART = "stdin";
    BufferedReader in;
    StringTokenizer tok;
    PrintWriter out;
    IOSystem() {in = new BufferedReader(new InputStreamReader(System.in));out = new PrintWriter(System.out);tok = new StringTokenizer("");}
    IOSystem(String inputFileName, String outputFileName) throws FileNotFoundException {in = new BufferedReader(new FileReader(inputFileName));out = new PrintWriter(outputFileName);tok = new StringTokenizer("");}
    String readString() throws IOException {while (!tok.hasMoreTokens()) {String line = in.readLine();if (line == null) return null;tok = new StringTokenizer(line);}return tok.nextToken();}
    int readInt() throws IOException {return Integer.parseInt(readString());}
    long readLong() throws IOException {return Long.parseLong(readString());}
    double readDouble() throws IOException {return Double.parseDouble(readString());}
    int[] readIntArray(int size) throws IOException {int[] array = new int[size];for (int i = 0; i < size; i++)array[i] = readInt();return array;}
    long[] readLongArray(int size) throws IOException {long[] array = new long[size];for (int i = 0; i < size; i++)array[i] = readLong();return array;}
    String[] readStringArray(int size) throws IOException {String[] array = new String[size];for (int i = 0; i < size; i++)array[i] = readString();return array;}
    double[] readDoubleArray(int size) throws IOException {double[] array = new double[size];for (int i = 0; i < size; i++)array[i] = readDouble();return array;}
}