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.*;
import java.*;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Random;
import java.lang.*;
 



 
 
public class zad {
private static BufferedReader in;
private static StringTokenizer tok;
private static PrintWriter out;
final static boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") !=null;
 
public static void init() throws FileNotFoundException{
if(ONLINE_JUDGE){
in = new BufferedReader(new InputStreamReader(System.in));
out = new PrintWriter(System.out);
}
else{
in = new BufferedReader(new FileReader("input.txt"));
out = new PrintWriter("out.txt");
}
}
 
private static String readString() throws IOException {
while (tok == null || !tok.hasMoreTokens()) {
tok = new StringTokenizer(in.readLine());
}
return tok.nextToken();
}
 
private static int readInt() throws IOException {
return Integer.parseInt(readString());
}
private static double readDouble() throws IOException {
return Double.parseDouble(readString());
}
private static long readLong() throws IOException {
return Long.parseLong(readString());
}
private static float readFloat() throws IOException{
    return Float.parseFloat(readString());
}
 
 public static class time{
     int ch;
     int min;
     time(int ch,int min){
         this.ch = ch;
         this.min = min;
     }
     public int getCh(){
         return ch;
     }
     public int getMin(){
         return min;
     }
     public boolean eq(time t1, time t2){
         if(t1.getCh()== t2.getCh() && t1.getMin() == t2.getMin())
             return true;
         return false;
     }
 }



public static void Solve() throws IOException{

    int n = readInt();
    
    while(n>0){
         if(360%(180-readInt())==0) {
             out.println("YES");
         }
         else out.println("NO");
         n--;
    }
    
}
    
    




public static void main(String[] args) throws IOException {
init();
Solve();
 
 
in.close();
out.close();
}
}