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.util.*;
import java.io.*;

public class Main{

	public static int contains(int [] array,int a){
		int c=0;
		for(int i=0;i<array.length;i++){
			if(array[i]==a){
				c=1;
				break;
			}else{
				c=2;
			}
		}return c;
	}

	public static void print(int[] array){
		for(int i=0;i<array.length;i++){

			System.out.print(array[i]+" ");
		}
		System.out.println();
	}

	public static int[] sort(int[] array){
		int h=array.length/2;  // here, h is the interval.
		while(h>0){
			for(int i=h;i<array.length;i++){
				int temp=array[i];
				int j;
				for( j=i;j>=h && array[j-h]>temp; j=j-h){
					array[j]=array[j-h];
				}
				array[j]=temp;

				print(array);
			}
			h=h/2;
			
		}
		return array;
	}

	public static boolean isUpperCase(String s){
		return s==s.toUpperCase();
	}
	public static boolean isLowerCase(String s){
		return s==s.toLowerCase();
	}

	public static int con(String s, String a){
		int c=0;
		for(int i=0;i<s.length();i++){
			if(s.substring(i,i+1).equals(a)){
				c=1;
				break;
			}else{
				c=2;
			}
		}
		return c;
	}

	public static int hcf(int a,int b){

        //int n1 = 81, n2 = 153, gcd = 1;
		int gcd=1;
        for(int i = 1; i <= a && i <= b; ++i)
        {
            // Checks if i is factor of both integers
            if(a % i==0 && b % i==0)
                gcd = i;
        }
        return gcd;

       // System.out.printf("G.C.D of %d and %d is %d", n1, n2, gcd);
	}

	
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		for(int i=0;i<t;i++){
			int a=sc.nextInt();
			if(360%(180-a)==0){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
		}
}
	public static long tprime(long a){
		long c=1;
		for(int i=1;i<=a/2;i++){
			if(a%i==0){
				c++;
			}
		}
		return c;
	}
	public static int cona(String s1,String s2){
		int c=0;
		for(int i=0;i<s1.length();i++){
			if(s1.substring(i,i+1).equals(s2)){
				c=1;
				break;
			}else{
				c=-1;
			}
		}
		return c;
	}
	public static int prime(int a){
		int c=0;
		for(int i=2;i<=a/2;i++){
			if(a%i==0){
				c=1;
				break;
			}else{
				c=0;
			}
		}
		return c;
	}

	public static int contains(String s,String a){
		int c=0;
		for(int i=0;i<s.length();i++){
			
			if(s.substring(i,i+1).equals(a)&&!a.equals("l")){
				c=1;
				break;
			}else if(a.equals("l")){
				int m=count(s,a);
				if(m==0 || m==1){
					c=0;
				}else{
					c=1;
					break;
				}
			}
			else{
				c=0;
			}
		}
		return c;
	}
	public static int count(String s,String a){
		int c=0;
		for(int i=0;i<s.length();i++){
			if(s.substring(i,i+1).equals(a)){
				c++;
			}
		}
		return c;
	}

	public static int minpos(int[] array,int c){
		int a=0;
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<array.length;i++){
			if(array[i]==c){
				list.add(i);
			}
		}
		Collections.sort(list);
		return list.get(list.size()-1);
	}
	public static int maxpos(int[] array,int c){
		ArrayList<Integer> list=new ArrayList<Integer>();
		for(int i=0;i<array.length;i++){
			if(array[i]==c){
				list.add(i);
			}
		}
		Collections.sort(list);
		return list.get(0);
	}
	
}
