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.*;

public class A_Fancy_Fence {
    double PI = 3.141592653589793238462643383279502884197169399375105820974944;
    int MOD = 1000000007;

    public static void main(String[] args) {
        FastScanner f = new FastScanner();
        Set<Integer> set=new HashSet<>();
        

        int t = f.ri();
        while (t-- > 0) {
            int n = f.ri();
            double val=((double)360)/(180-n);
            if((int)Math.floor(val)==(int)Math.ceil(val)){
                System.out.println("YES");
            }
            else{
                System.out.println("NO");
            }

        }

    }

    // any other class you make,make it static.

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String rs() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int ri() {
            return Integer.parseInt(rs());
        }

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

        long rl() {
            return Long.parseLong(rs());
        }
    }

    static void sort(int[] a) {
        ArrayList<Integer> l = new ArrayList<>();
        for (int i : a)
            l.add(i);
        Collections.sort(l);
        for (int i = 0; i < a.length; i++)
            a[i] = l.get(i);
    }

    static int gcd(int a, int b) {
        return (b == 0) ? a : gcd(b, a % b);
    }

    static long ncr(int n, int k) // note it returns long
    {
        if (k > n - k) {
            k = n - k;
        }
        long c[] = new long[k + 1];
        c[0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = Math.min(i, k); j > 0; j--) {
                c[j] = c[j] + c[j - 1];
                // c[j]=c[j]%(1000000000+7);when asked or int is used instead of long
            }
        }
        return c[k];
    }

    public void nextPermutation(int[] nums) {
        int mark = -1;
        for (int i = nums.length - 1; i > 0; i--) {
            if (nums[i] > nums[i - 1]) {
                mark = i - 1;
                break;
            }
        }

        if (mark == -1) {
            reverse(nums, 0, nums.length - 1);
            return;
        }

        int idx = nums.length - 1;
        for (int i = nums.length - 1; i >= mark + 1; i--) {
            if (nums[i] > nums[mark]) {
                idx = i;
                break;
            }
        }

        swap(nums, mark, idx);

        reverse(nums, mark + 1, nums.length - 1);
    }

    public void swap(int[] nums, int i, int j) {
        int t = nums[i];
        nums[i] = nums[j];
        nums[j] = t;
    }

    public void reverse(int[] nums, int i, int j) {
        while (i < j) {
            swap(nums, i, j);
            i++;
            j--;
        }
    }

}
