#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        for(int i=t-1;i>=0;i--){
            ll co=0,_size=0,temp=1;
            for(int j=i;j>=0;j--){
                _size++;
                if(s[j]=='1'){
                    co+=temp;
                }
                if(_size==co)Fans++;
                if(co>t)break;
                temp = temp<<1;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        for(int i=t-1;i>=0;i--){
            ll co=0,_size=0,temp=1;
            for(int j=i;j>=0;j--){
                _size++;
                if(s[j]=='1'){
                    co+=temp;
                }
                if(_size==co)Fans++;
                if(co>t)break;
                temp = temp*2;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


//#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        for(int i=t-1;i>=0;i--){
            ll co=0,_size=0,temp=1;
            for(int j=i;j>=0;j--){
                _size++;
                if(_size>20)break;
                if(s[j]=='1'){
                    co+=temp;
                }
                if(_size==co)Fans++;
                temp = temp*2;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        for(int i=t-1;i>=0;i--){
            ll co=0,_size=0,temp=1;
            for(int j=i;j>=0;j--){
                _size++;
                if(s[j]=='1'){
                    if(temp>=500000)break;
                    co+=temp;
                }
                if(_size==co)Fans++;
                if(co>i)break;
                if(temp<500000)
                    temp = temp<<1;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        fo(i,0,t){
            ll co=0,_size=0;
            fo(j,i,t){
                co=co<<1;_size++;
                if(s[j]=='1'){
                    co++;
                }
                if(_size==co)Fans++;
                if(co>t)break;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


//#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define Ahmed_El_Moataz           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,b)                 for(int i=(a);i<(b);i++)
#define ll long long
#define ld long double
#define endl "\n"
#define ull unsigned long long
#define ALL(v) ((v).begin()), ((v).end())
#define INCREASING(v) sort(ALL(v))
#define DECREASING(v) INCREASING(v), reverse(ALL(v))
#define ReadFile freopen("input.in","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f,NegOO= -1*OO;
double Pi=acos(-1);
const double long rad=Pi/180.0;
ll GCD(ll a,ll b){return (b == 0) ? a : GCD (b, a % b);}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}
ll Pow(ll b, ll p){return (p)?((p & 1)? b:0) + Pow((b<<1),(p>>1)):1;}
ll nCr (ll n,ll m){return(m == 0)?1:n*nCr(n-1,m-1)/m;}
/*****************************************************/

int main()
{
    Ahmed_El_Moataz
    int T;cin>>T;
    while(T--){
        string s;cin>>s;
        ll Fans=0,t=s.size();
        fo(i,0,t){
            ll co=0,_size=0;
            fo(j,i,t){
                co=co*2;_size++;
                if(s[j]=='1'){
                    co++;
                }
                if(_size==co)Fans++;
                if(co>t)break;
            }
        }
        cout<<Fans<<"\n";
    }

}
/*
*/


import java.io.*;
import java.util.*;
public class Scanner {

	BufferedReader br;
	StringTokenizer st;
	Scanner()
	{
		br = new BufferedReader(new InputStreamReader(System.in));
	}
	String next() throws IOException
	{
		while(st == null ||  !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException
	{
		return Integer.parseInt(next());
	}

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner();
		int t = sc.nextInt();
		while(t-- > 0)
		{
			int n = sc.nextInt();
			if(360%(180-n)==0)System.out.println("YES");
			else System.out.println("NO");
		}

	}
}


import java.io.*;
import java.util.*;
public class Scanner {

	BufferedReader br;
	StringTokenizer st;
	Scanner()
	{
		br = new BufferedReader(new InputStreamReader(System.in));
	}
	String next() throws IOException
	{
		while(st == null ||  !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException
	{
		return Integer.parseInt(next());
	}

	public static void main(String[] args) throws IOException {

//		Scanner sc = new Scanner()
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int t = sc.nextInt();
		while(t-- > 0)
		{
			int n = sc.nextInt();
			if(360%(180-n)==0)System.out.println("YES");
			else System.out.println("NO");
		}

	}
}


import java.util.*;

public class hello {

    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
    int t=sc.nextInt();
    while (t-->0){
        int a=sc.nextInt();
        if(a>=60){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
    }
}


import java.util.*;

public class hello {

    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
    int t=sc.nextInt();
    while (t-->0){
        int a=sc.nextInt();
        if(360%(180-a)==0){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
    }
}


import java.util.*;

public class hello {

    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
    int t=sc.nextInt();
    while (t-->0){
        int a=sc.nextInt();
        if(a>=60 && a<=180){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
    }
}


import java.util.*;
import java.lang.*;
public class FancyFence
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        for (int i=0; i<t; i++)
        {
            String output="";
            int a=sc.nextInt();
            float x=180-a;
            x=360/x;
            if (x%1==0)
                output="YES";
            else
                output="NO";
            System.out.println(output);
        }
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        final int sub = 180;
        for (int t = in.nextInt(); t > 0; t--) {
            int a = in.nextInt();
            double n = (double)(sub * 2) / (double)(sub - a);
            if (n % 1 != 0 || n < 0) {
                System.out.println("NO");
            } else {
                System.out.println("YES");
            }
        }
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
 {
	public static void main (String[] args) throws Exception
	 {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
     	int t = Integer.parseInt(br.readLine());
     	while(t-- > 0){
            int num = Integer.parseInt(br.readLine());
            float angle = 60;
            float n = 4;
            while(angle < num){
                angle = ((n-2) * 180 ) / (n);
                ++n;
            }
            if(angle == num)
                pw.println("YES");
            else
                pw.println("NO");
     	}
        pw.flush();
	 }
}


import java.util.*;
public class FancyFence {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t= sc.nextInt();
		while(t--!=0) {
			int a= sc.nextInt();
			if(360%(180-a)==0) System.out.println("YES");
			else System.out.println("NO");
		}

	}

}


import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
	InputStream inputStream = System.in;
	Scanner in = new Main().new Scanner(inputStream);
	Main solver = new Main();
	solver.solve(in);
    }

    public void solve(Scanner in) {
	int n = in.ni();
	for (int i = 0; i < n; i++) {
	    int t = in.ni();
	    if(t < 60) {
		System.out.println("NO");
	    } else if (360 % (180 - t) == 0){
		System.out.println("YES");
	    } else {
		System.out.println("NO");
	    }
	}
    }

    class Scanner {
	BufferedReader br;
	StringTokenizer in;

	public Scanner(InputStream inputStream) {
	    br = new BufferedReader(new InputStreamReader(inputStream));
	}

	public String next() {
	    return hasMoreTokens() ? in.nextToken() : null;
	}

	public String readLine() {
	    try {
		return br.readLine();
	    } catch (Exception e) {
		e.printStackTrace();
		return null;
	    }
	}

	boolean hasMoreTokens() {
	    while (in == null || !in.hasMoreTokens()) {
		String s = readLine();
		if (s == null)
		    return false;
		in = new StringTokenizer(s);
	    }
	    return true;
	}

	public String nextString() {
	    return next();
	}

	public int ni() {
	    return Integer.parseInt(nextString());
	}

	public long nl() {
	    return Long.parseLong(nextString());
	}

	public int[] nia(int n) {
	    int[] a = new int[n];
	    for (int i = 0; i < n; i++) {
		a[i] = ni();
	    }
	    return a;
	}

	public long[] nla(int n) {
	    long[] a = new long[n];
	    for (int i = 0; i < n; i++) {
		a[i] = ni();
	    }
	    return a;
	}
    }

    class Pair<T> implements Comparable<T> {
	T a;
	T b;

	public Pair(T c, T d) {
	    a = c;
	    b = d;
	}

	public String toString() {
	    return "[" + a.toString() + "," + b.toString() + "]";
	}

	public int compareTo(T o) {
	    return a.toString().compareTo(b.toString());
	}

	@Override
	public boolean equals(Object obj) {
	    Pair<T> p2 = (Pair<T>) obj;
	    if (p2.a == a && p2.b == b)
		return true;
	    return false;
	}

    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int i,n,j,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextInt();
	    String s=" that";
	   // long ans=0l,ans1=0l,k,h;

	   // int a[]=new int[n];

	   while(t-->0)
	   {
	       n=sc.nextInt();
	       if(360%n!=0){
	       System.out.println("NO");continue;}
	       if(n<45||n>135){
	       System.out.println("NO");continue;}
	       System.out.println("YES");
	   }
}
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    long i,n,j,s,a,b,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextLong();
	   // b=sc.nextLong();
	   // s=sc.nextLong();
	   // long ans=0l,ans1=0l,k,h;
	   // int a[]=new int[t];
	    outer:while(t-->0)
	    {
	        a=sc.nextLong();
	        i=3;
	        while(i<180)
	        {
	            b=360/i;
	            b=180-b;
	            i++;
	            if(b==a)
	            {
	                System.out.println("YES");
	                continue outer;
	            }
	        }
	        System.out.println("NO");
	    }
    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int i,n,j,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextInt();
	    String s=" that";
	   // long ans=0l,ans1=0l,k,h;

	   // int a[]=new int[n];

	   while(t-->0)
	   {
	       n=sc.nextInt();
	       if(360%n!=0){
	       System.out.println("NO");continue;}
	       if(n<45||n==180){
	       System.out.println("NO");continue;}
	       System.out.println("YES");
	   }
}
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    int i,n,j,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextInt();
	    String s=" that";
	   // long ans=0l,ans1=0l,k,h;

	   // int a[]=new int[n];

	   while(t-->0)
	   {
	       n=sc.nextInt();
	       //if(360%n!=0){
	       //System.out.println("NO");continue;}
	       if(n<45||n==180){
	       System.out.println("NO");continue;}
	       System.out.println("YES");
	   }
}
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    long i,n,j,s,a,b,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextLong();
	   // b=sc.nextLong();
	   // s=sc.nextLong();
	   // long ans=0l,ans1=0l,k,h;
	   // int a[]=new int[t];
	    outer:while(t-->0)
	    {
	        a=sc.nextLong();
	        i=3;
	        while(i<360)
	        {
	            b=360/i;
	            b=180-b;
	            i++;
	            if(b==a)
	            {
	                System.out.println("YES");
	                continue outer;
	            }
	        }
	        System.out.println("NO");
	    }
    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    long i,n,j,s,a,b,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextLong();
	   // b=sc.nextLong();
	   // s=sc.nextLong();
	   // long ans=0l,ans1=0l,k,h;
	   // int a[]=new int[t];
	    outer:while(t-->0)
	    {
	        a=sc.nextLong();
	        if(360%(180-a)==0)
	                System.out.println("YES");
	                else
	        System.out.println("NO");
	    }
    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	    Scanner sc=new Scanner(System.in);
	    long i,n,j,s,a,b,t,l,m,k;
	    long max=0l,sum=0l,ans=0l,flag=0l;
	   // float sum=0f;
	   // n=sc.nextInt();
	    t=sc.nextLong();
	   // b=sc.nextLong();
	   // s=sc.nextLong();
	   // long ans=0l,ans1=0l,k,h;
	   // int a[]=new int[t];
	    outer:while(t-->0)
	    {
	        a=sc.nextLong();
	        if(360%(180-a)==0)
	                System.out.println("YES");
	        System.out.println("NO");
	    }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FancyFence {
    int a;
    public static void main(final String[] args) throws IOException {
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int t;
        t = Integer.parseInt(bufferedReader.readLine());
        while(t-- > 0) {
            FancyFence fafaandhisCompany = new FancyFence(bufferedReader);
            if(fafaandhisCompany.canBuild())  System.out.println("YES");
            else    System.out.println("NO");
        }
    }
    FancyFence(final BufferedReader bufferedReader) throws IOException {
        a = Integer.parseInt(bufferedReader.readLine());
    }
    boolean canBuild() { return a >= 45 && a <= 315; }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FancyFence {
    int a;
    public static void main(final String[] args) throws IOException {
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int t;
        t = Integer.parseInt(bufferedReader.readLine());
        while(t-- > 0) {
            FancyFence fafaandhisCompany = new FancyFence(bufferedReader);
            if(fafaandhisCompany.canBuild())  System.out.println("YES");
            else    System.out.println("NO");
        }
    }
    FancyFence(final BufferedReader bufferedReader) throws IOException {
        a = Integer.parseInt(bufferedReader.readLine());
    }
    boolean canBuild() { return a >= 45 && a <= 90; }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;

public class FancyFence {
    int a;
    public static void main(final String[] args) throws IOException {
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int t;
        t = Integer.parseInt(bufferedReader.readLine());
        while(t-- > 0) {
            if(new FancyFence(bufferedReader).canBuild())  System.out.println("YES");
            else    System.out.println("NO");
        }
    }
    FancyFence(final BufferedReader bufferedReader) throws IOException {
        a = Integer.parseInt(bufferedReader.readLine());
    }
    boolean canBuild() {
        int angle, i;
        angle = a;
        TreeSet<Point> points;
        points = new TreeSet<>();
        Point curr, next;
        curr = new Point(0.0, 0.0);
        i = 360;
        double distance;
        distance = 100.0;
        while(i-- > 0) {
            points.add(curr);
            next = nextPoint(curr, angle*Math.PI/180.0, distance);
            curr = next;
            if(points.contains(curr) || curr.y <= -0.01)       break;
            angle += a;
            angle -= 180;
        }
        return curr.isSamePoint(new Point(0.0, 0.0));
    }
    class Point implements Comparable<Point>{
        double x, y;
        Point(double xx, double yy) {
            x = xx;
            y = yy;
        }
        boolean isSamePoint(Point point) {
            return Math.abs(x-point.x) <= 0.01 && Math.abs(y-point.y) <= 0.01;
        }
        public int compareTo(Point point) {
            if(x - point.x <= 0.01) return -1;
            if(x == point.x && y == point.y)    return 0;
            return 1;
        }
    }
    Point nextPoint(Point curr, double angle, double distance) {
        return new Point(curr.x + Math.cos(angle)*distance, curr.y + Math.sin(angle)*distance);
    }
}


import java.util.Scanner;
import java.util.ArrayList;

public class NewClass {

    public static void main(String[] args){
        Scanner lukija = new Scanner(System.in);

        int testiMaara = Integer.valueOf(lukija.nextLine());
        ArrayList<String> output = new ArrayList<>();

        for(int i = 0; i < testiMaara; i++){
            int kulma = Integer.valueOf(lukija.nextLine());
            if(kulma < 60){
                output.add("NO");
                continue;
            }
            //N sivuisen rpolygonin kulma on (180 - 360/N)/2 == k
            int alfa = 180 - kulma;
            if(360 % alfa == 0){
                output.add("YES");
            }else{
                output.add("NO");
            }

        }
        for( String tulos : output){
            System.out.println(tulos);
        }

    }
}


import java.awt.Point;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    static Scanner input = new Scanner(System.in);

    public static void main(String[] args) {

    	int n = input.nextInt();

    	for (int w = 0; w < n; w++) {
    		int angle = input.nextInt();

    		int sidesI = 360 / (180 - angle);
    		double sidesD = 360.0 / (180 - angle);

    		if (sidesD - sidesI > 1e-6)
    			System.out.println("NO");
    		else
    			System.out.println("YES");

    	}

      }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;

public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }
        static int T;

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
        T = sc.nextInt();while (T--!=0)
        {
            solve();

        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
  // static  FastReader sc = new FastReader();
   static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
        int n =sc.nextInt();
        System.out.println(2*n%(180-n)==0?"YES":"NO");

///////////////////////////////////////////////////////////////////////
    }

}


import java.util.Scanner;
public class degreepolygon{
  public static void main(String []args){

    degpol();
  }

  public static void degpol(){
   Scanner sc=new Scanner(System.in);
     int x=sc.nextInt();
    for(int i=1; i<=x; i++){

      int s=sc.nextInt();

      if((360%(180-s))==0)

      {
       System.out.println("YES");
      }
      else{
        System.out.println("NO");
    }

  }

}
}


public class degreepolygon{
  public static void main(String []args){

    degpol();
  }

  public static void degpol(){
   Scanner sc=new Scanner(System.in);
     int x=sc.nextInt();
    for(int i=1; i<=x; i++){

      int s=sc.nextInt();

      if((360%(180-s))==0)

      {
       System.out.println("YES");
      }
      else{
        System.out.println("NO");
    }

  }

}
}


import java.util.*;
import java.io.*;
import java.math.*;
/*
javac Main.java
java Main > a.txt
*/
public class Main
{

    public static void process()throws IOException
    {
      int a=ni();
      double n=(360*1.0/(180-a));
      if(n-Math.floor(n)==0)
        pn("YES");else pn("NO");
    }
    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;
         //PrintWriter out=new PrintWriter("output");
        //oj = System.getProperty("ONLINE_JUDGE") != null;
        //if(!oj) sc=new AnotherReader(100);

         int T=ni(); while(T-->0)
            process();

        long s = System.currentTimeMillis();

        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }
    static void sort(long arr[],int n)
    {
    shuffle(arr,n);
    Arrays.sort(arr);
    }
    static void shuffle(long arr[],int n)
    {
        Random r=new Random();
        for(int i=0;i<n;i++)
        {
          long temp=arr[i];
          int pos=i+r.nextInt(n-i);
          arr[i]=arr[pos];
          arr[pos]=temp;
        }
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static String nn()throws IOException{return sc.next();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static int[] iarr(int N)throws IOException{int[]ARR=new int[N];for(int i=0;i<N;i++){ARR[i]=ni();}return ARR;}
    static long[] larr(int N)throws IOException{long[]ARR=new long[N];for(int i=0;i<N;i++){ARR[i]=nl();}return ARR;}
    static boolean multipleTC=false;

/////////////////////////////////////////////////////////////////////////////////////////////////////////
    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


import java.awt.desktop.PreferencesEvent;
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Ladder {
    public static void main(String[] args) throws IOException {
        //BufferedReader reader=new BufferedReader(new FileReader("input.txt"));
        //PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Scanner scanner=new Scanner(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        Reader scanner = new Reader();
        int n=scanner.nextInt();
        for (int i = 0; i <n ; i++) {
            int t=scanner.nextInt();
            if (t<60){
                pw.println("NO");
            }
            else
                pw.println("YES");
        }

        pw.close();

    }

}
/*
class tuple implements Comparable<tuple>{
    int a;
    int b;

    public tuple(int a, int b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public int compareTo(tuple o) {
        return this.a-o.a;
    }
}

*/
class Reader {
    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;

    public Reader() {
        din = new DataInputStream(System.in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public Reader(String file_name) throws IOException {
        din = new DataInputStream(new FileInputStream(file_name));
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public String readLine() throws IOException {
        byte[] buf = new byte[64];
        int cnt = 0, c;
        while ((c = read()) != -1) {
            if (c == '\n') break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }

    public int nextInt() throws IOException {
        int ret = 0;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (neg) return -ret;
        return ret;
    }

    public long nextLong() throws IOException {
        long ret = 0;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (neg) return -ret;
        return ret;
    }

    public double nextDouble() throws IOException {
        double ret = 0, div = 1;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
        if (neg) return -ret;
        return ret;
    }

    private void fillBuffer() throws IOException {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1) buffer[0] = -1;
    }

    private byte read() throws IOException {
        if (bufferPointer == bytesRead) fillBuffer();
        return buffer[bufferPointer++];
    }

    public void close() throws IOException {
        if (din == null) return;
        din.close();
    }
}


import java.awt.desktop.PreferencesEvent;
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Ladder {
    public static void main(String[] args) throws IOException {
        //BufferedReader reader=new BufferedReader(new FileReader("input.txt"));
        //PrintWriter pw=new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //Scanner scanner=new Scanner(System.in);
        PrintWriter pw=new PrintWriter(System.out);
        Reader scanner = new Reader();
        int n=scanner.nextInt();
        for (int i = 0; i <n ; i++) {
            int t=scanner.nextInt();
            if (t>=60 && 360%(180-t)==0){
                pw.println("YES");
            }
            else
                pw.println("NO");
        }

        pw.close();

    }

}
/*
class tuple implements Comparable<tuple>{
    int a;
    int b;

    public tuple(int a, int b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public int compareTo(tuple o) {
        return this.a-o.a;
    }
}

*/
class Reader {
    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;

    public Reader() {
        din = new DataInputStream(System.in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public Reader(String file_name) throws IOException {
        din = new DataInputStream(new FileInputStream(file_name));
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public String readLine() throws IOException {
        byte[] buf = new byte[64];
        int cnt = 0, c;
        while ((c = read()) != -1) {
            if (c == '\n') break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }

    public int nextInt() throws IOException {
        int ret = 0;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (neg) return -ret;
        return ret;
    }

    public long nextLong() throws IOException {
        long ret = 0;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (neg) return -ret;
        return ret;
    }

    public double nextDouble() throws IOException {
        double ret = 0, div = 1;
        byte c = read();
        while (c <= ' ') c = read();
        boolean neg = (c == '-');
        if (neg) c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
        if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
        if (neg) return -ret;
        return ret;
    }

    private void fillBuffer() throws IOException {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1) buffer[0] = -1;
    }

    private byte read() throws IOException {
        if (bufferPointer == bytesRead) fillBuffer();
        return buffer[bufferPointer++];
    }

    public void close() throws IOException {
        if (din == null) return;
        din.close();
    }
}


import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
Scanner nerd = new Scanner (System.in);
int t = nerd.nextInt();
int[] a = new int[t];
for (int i = 0; i < t; i++)
{
  a[i] = nerd.nextInt();
  if (360 % (180 - a[i]) == 0)
  System.out.println("YES");
  else
  System.out.println("NO");
}
  }
}


import java.util.*;
import java.io.*;

public class Main {
  public static void main(String[] args) {
Scanner nerd = new Scanner (System.in);
int t = nerd.next();
int[] a = new int[t];
for (int i = 0; i < t; i++)
{
  a[i] = nerd.nextInt();
  if (360 % (180-x) == 0)
  System.out.println("YES");
  else
  System.out.println("NO");
}
  }
}


//https://codeforces.com/problemset/problem/270/A
import java.util.Scanner;
public class Polygon {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int lines = scan.nextInt();
        for (int i = 0; i < lines; i++) {
            int angle = scan.nextInt();
            double side = 360.0/(180.0-angle);
            if ((side%2 == 0.0) | (side%2 == 1.0)) {
                System.out.println("YES");
            }else
                System.out.println("NO");
        }
    }
}


import java.util.*;
public class HelloWorld{

     public static void main(String []args){
       Scanner sc = new Scanner(System.in);
       int test = sc.nextInt();
       while (test>0){
           int n = sc.nextInt();
           double ans = (double)360/(double)(180-n);
           if (Math.ceil(ans) == Math.floor(ans)){
               System.out.println("YES");
           }else{
               System.out.println("NO");
           }
           test--;
       }

     }
}


import java.util.*;
public class HelloWorld{

     public static void main(String []args){
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       double ans = (double)360/(double)(180-n);
       if (Math.ceil(ans) == Math.floor(ans)){
           System.out.println("YES");
       }else{
           System.out.println("NO");
       }
     }
}


//Written by Shagoto
import java.util.*;
public class Main
{
  public static void main(String[]args)
  {
    Scanner read = new Scanner(System.in);

    int t = read.nextInt();
    for(int x = 1; x<=t; x++)
    {
      int a = read.nextInt();

      double ans = 0;
      for(int i = 3; ans<a; i++)
      {
        ans = (i-2) * 180 / (double)i;
      }

      if(ans == a)
      {
        System.out.println("YES");
      }
      else
      {
        System.out.println("NO");
      }
    }
  }
}


//Written by Shagoto
import java.util.*;
public class Main
{
  public static void main(String[]args)
  {
    Scanner read = new Scanner(System.in);

    int t = read.nextInt();
    for(int x = 1; x<=t; x++)
    {
      int a = read.nextInt();

      int ans = 0;
      for(int i = 3; ans<a; i++)
      {
        ans = (i-2) * 180 / i;
      }

      if(ans == a)
      {
        System.out.println("YES");
      }
      else
      {
        System.out.println("NO");
      }
    }
  }
}


import java.util.Scanner;

public class Polygon {

	public static void main(String[] args) {

		Scanner s=new Scanner(System.in);

		int t=s.nextInt();

		for(int i=0;i<t;i++)
		{
			int a=s.nextInt();
			int ans=360%(180-a);

			if(ans==0)
			{
				System.out.println("YES");
			}
			else
			{
				System.out.println("NO");
			}
		}
	}
}


import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int q = in.nextInt();

        int[] num = new int[q];
        int[] p = {60,90,108,120,128,135,140,144,147};
        boolean[] qwe = new boolean[q];
        for (int i = 0; i <q;i++){
            num[i] = in.nextInt();
        }

        for (int i = 0; i < q; i++){
                if (num[i] == 60||num[i] == 90||num[i] == 108||num[i] == 120||num[i] == 128){
                    System.out.println("YES");
                }
                else System.out.println("NO");
        }

    }
}


import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int q = in.nextInt();

        int[] num = new int[q];
        for (int i = 0; i <q;i++){
            num[i] = in.nextInt();
        }

        for (int i = 0; i < q; i++){
            if (360%(180-num[i])==0){
                System.out.println("YES");
            }
            else System.out.println("NO");
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) {

		FastReader scan = new FastReader();

			int t = scan.nextInt();

			while(t--> 0) {
				int a = scan.nextInt();

				if(360 % (180-a) == 0) System.out.println("YES");
				else System.out.println("NO");

			}

  }

	// sieveOfEratosthenes
	public static boolean[] sieveOfEratosthenes(int n) {
		boolean[] prime = new boolean[n+1];

		Arrays.fill(prime, true);
		prime[0] = false;
		prime[1] = false;

		for(int i=2; i*i<n; i++) {
			if(prime[i] == true) {
				for(int j=i*2; j<=n; j+=i) {
					prime[j] = false;
				}
			}
		}

		return prime;
	}

	//smallestFactor function
	public static long smallestFactor(long n) {
		int i;
		for(i=2; i<n; i++) {
			if(n%i == 0)
				break;
		}
		return i;
	}

	//FastReader Class
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

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

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}
}


    import javax.swing.*;
    import java.awt.desktop.SystemSleepEvent;
    import java.util.*;
    import java.io.*;

    public class Main {
        public static class FastReader {
            BufferedReader br;
            StringTokenizer st;

            public FastReader() {
                br = new BufferedReader(new InputStreamReader(System.in));
            }

            String nextLine() {
                String str = "";
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }

            int nextInt() {
                return Integer.parseInt(next());
            }

            long nextLong() {
                return Long.parseLong(next());
            }

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

            String next() {
                while (st == null || !st.hasMoreElements()) {
                    try {
                        st = new StringTokenizer(br.readLine());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

        }
        public class pair {
            int a;
            int b;

            pair(int p, int q) {
                a = p;
                b = q;
            }
            public int hashCode() {
                return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
            }
        }

        public static int gcd(int a, int b) {
            if (a == 1 || b == 1)
                return 1;
            if (a == 0)
                return b;
            if (b == 0)
                return a;
            return gcd(b % a, a);
        }

        public static void main(String[] args) {
            FastReader s = new FastReader();
            int t=s.nextInt();
            while(t>0)
            {
                int n=s.nextInt();
                if(360%(180-n)==0)
                    System.out.println("YES");
                else
                    System.out.println("NO");

                t--;
            }

            }
    }


    import javax.swing.*;
    import java.awt.desktop.SystemSleepEvent;
    import java.util.*;
    import java.io.*;

    public class Main {
        public static class FastReader {
            BufferedReader br;
            StringTokenizer st;

            public FastReader() {
                br = new BufferedReader(new InputStreamReader(System.in));
            }

            String nextLine() {
                String str = "";
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }

            int nextInt() {
                return Integer.parseInt(next());
            }

            long nextLong() {
                return Long.parseLong(next());
            }

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

            String next() {
                while (st == null || !st.hasMoreElements()) {
                    try {
                        st = new StringTokenizer(br.readLine());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

        }
        public class pair {
            int a;
            int b;

            pair(int p, int q) {
                a = p;
                b = q;
            }
            public int hashCode() {
                return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
            }
        }

        public static int gcd(int a, int b) {
            if (a == 1 || b == 1)
                return 1;
            if (a == 0)
                return b;
            if (b == 0)
                return a;
            return gcd(b % a, a);
        }

        public static void main(String[] args) {
            FastReader s = new FastReader();
            int t=s.nextInt();
            while(t>0)
            {
                int n=s.nextInt();
                int x = 180/n;
                if(x>1)
                {
                    if((2*x)%(x-1)==0)
                        System.out.println("YES");
                    else
                        System.out.println("NO");
                }
                else
                    System.out.println("NO");

                t--;
            }

            }
    }


    import javax.swing.*;
    import java.awt.desktop.SystemSleepEvent;
    import java.util.*;
    import java.io.*;

    public class Main {
        public static class FastReader {
            BufferedReader br;
            StringTokenizer st;

            public FastReader() {
                br = new BufferedReader(new InputStreamReader(System.in));
            }

            String nextLine() {
                String str = "";
                try {
                    str = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                return str;
            }

            int nextInt() {
                return Integer.parseInt(next());
            }

            long nextLong() {
                return Long.parseLong(next());
            }

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

            String next() {
                while (st == null || !st.hasMoreElements()) {
                    try {
                        st = new StringTokenizer(br.readLine());
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

        }
        public class pair {
            int a;
            int b;

            pair(int p, int q) {
                a = p;
                b = q;
            }
            public int hashCode() {
                return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
            }
        }

        public static int gcd(int a, int b) {
            if (a == 1 || b == 1)
                return 1;
            if (a == 0)
                return b;
            if (b == 0)
                return a;
            return gcd(b % a, a);
        }

        public static void main(String[] args) {
            FastReader s = new FastReader();
            int t=s.nextInt();
            while(t>0)
            {
                int n=s.nextInt();
                int x = 180/n;
                if((2*x)%(x-1)==0)
                    System.out.println("YES");
                else
                    System.out.println("NO");

                t--;
            }

            }
    }


import java.util.Scanner;

/**
 *
 * @author Tonmoy
 */
public class Fancy_Fence_270A {
    public static void main(String[] args) {
        Scanner In=new Scanner(System.in);
        int t=In.nextInt();
        for (int i = 0; i < t; i++) {
          int ang=In.nextInt();
          int x=180-ang;
          if(360%x==0){
              System.out.println("YES");
          }
          else{
              System.out.println("NO");
          }
        }
    }
}


import java.util.Scanner;

/**
 *
 * @author Tonmoy
 */
public class Fancy_Fence_270A {
    public static void main(String[] args) {
        Scanner In=new Scanner(System.in);
        int t=In.nextInt();
        for (int i = 0; i < t; i++) {
            float ang=In.nextFloat();
            if(ang>=60.0){
                System.out.println("YES");
            }
            else{
                System.out.println("NO");
            }
        }
    }
}


import java.util.Scanner;

/**
 *
 * @author Tonmoy
 */
public class Fancy_Fence_270A {
    public static void main(String[] args) {
        Scanner In=new Scanner(System.in);
        int t=In.nextInt();
        for (int i = 0; i < t; i++) {
            float ang=In.nextFloat();
            float k;
            for (float j=3; j <400 ; j++) {
                 k=(float) (((j-2.0)*180)/j);
                if(k==ang){
                    System.out.println("YES");
                    break;
                }
               if(j>k){
                   System.out.println("NO");
                   break;
               }
            }
        }
    }
}


import java.lang.*;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
public class MyClass {
    public static void main(String args[])throws Exception {
        Scanner sc=new Scanner(System.in);

         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

long l=sc.nextLong();

while(l>0)
{
    int t=sc.nextInt();
    if(360%(180-t)==0)
    System.out.println("YES");
    else
    System.out.println("NO");
    l--;
}

}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
 {
	public static void main (String[] args) throws Exception
	 {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
     	int t = Integer.parseInt(br.readLine());
     	while(t-- > 0){
            int num = Integer.parseInt(br.readLine());
            int angle = 60;
            // pw.println(angle+" "+num);
            int n = 4;
            while(angle < num){
                angle = ((n-2) * 180 ) / (n);
                ++n;
            }
            if(angle == num)
                pw.println("YES");
            else
                pw.println("NO");
     	}
        pw.flush();
	 }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
 {
	public static void main (String[] args) throws Exception
	 {
     	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
     	int t = Integer.parseInt(br.readLine());
     	while(t-- > 0){
            int num = Integer.parseInt(br.readLine());
            float angle = 60;
            // pw.println(angle+" "+num);
            float n = 4;
            while(angle < num){
                angle = ((n-2) * 180 ) / (n);
                ++n;
            }
            if(angle == num)
                pw.println("YES");
            else
                pw.println("NO");
     	}
        pw.flush();
	 }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FancyFence {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int test_ = Integer.parseInt(bf.readLine());
        while (test_-->0){
            int a = Integer.parseInt(bf.readLine());
            for (int i = 3; ; i++) {
                int polygon_angle = (i-2)*180/i;
                if (polygon_angle==a){
                    System.out.println("YES");
                    break;
                }
                else if (polygon_angle>a){
                    System.out.println("NO");
                    break;
                }
            }
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FancyFence {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int test_ = Integer.parseInt(bf.readLine());
        while (test_-->0){
            double a = Integer.parseInt(bf.readLine());
            for (double i = 3; ; i++) {
                double polygon_angle = (i-2)*180/i;
                if (polygon_angle==a){
                    System.out.println("YES");
                    break;
                }
                else if (polygon_angle>a){
                    System.out.println("NO");
                    break;
                }
            }
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Fancy_Fence {

	public static void main(String[] args) {
		FastReader fr = new FastReader();
		int t = fr.nextInt();

		while(t-- > 0)
		{
			int a = fr.nextInt();

			System.out.println((360 % (180 - a) == 0)?"YES" : "NO");
		}
	}
	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {

				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

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


import java.util.*;

public class cp{
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int len = sc.nextInt();

		while(len-->0)
		{
			int an = sc.nextInt();
int i=0;
			for(i=3;i<=360;i++)
			{
				if((i-2)*180==an*i)
				{
					break;
				}
			}

			if(i!=361)
			{
				System.out.println("YES");
			}else System.out.println("NO");
		}
	}
}


import java.util.ArrayList;
import java.util.Scanner;
public class acm {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int t=in.nextInt();
		for(int i=0;i<t;i++)
		{
			int num=in.nextInt();

			double x =num/180.00,n=(2.00)/(1.00-x);

			boolean hasDecimal=((int)Math.round((n*100)))%100!=0?true:false;

			if(hasDecimal)
				System.out.println("NO");
			else
				System.out.println("YES");

		}

	}}


import java.util.ArrayList;
import java.util.Scanner;
public class acm {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);

		ArrayList<Double>arr=new ArrayList<>();

		for(int i=3;i<400;i++)
			arr.add(((i-2)*180.0)/i);

		int t=in.nextInt();
		while(t-->0)
		{
			double x =in.nextDouble();

			if(arr.contains(x))
				System.out.println("YES");
			else
				System.out.println("NO");

		}

	}}


import java.util.ArrayList;
import java.util.Scanner;
public class acm {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);

		ArrayList<Integer>arr=new ArrayList<>();

		for(int i=3;i<400;i++)
			arr.add(((i-2)*180)/i);

		int t=in.nextInt();
		while(t-->0)
		{
			int x =in.nextInt();

			if(arr.contains(x))
				System.out.println("YES");
			else
				System.out.println("NO");

		}

	}}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class _02FancyFence {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int t = Integer.parseInt(st.nextToken());
        while (t-- > 0){
            st = new StringTokenizer(br.readLine());
            int a = Integer.parseInt(st.nextToken());
            String res = "NO";
            if (a < 90) {
                if (a == 60) res = "YES";
            } else if (a >= 90) {
                if (a % 30 == 0) res = "YES";
            }
            System.out.println(res);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class _02FancyFence {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int t = Integer.parseInt(st.nextToken());
        while (t-- > 0){
            st = new StringTokenizer(br.readLine());
            int a = Integer.parseInt(st.nextToken());
            int q = a;
            int n = 0;
            String res = "NO";
            if (a == 60) res = "YES";
            else if (a >= 90){
                for (int i = 4; n < q; i++) {
                    n = (i-2)*180;
                    q = a*i;
                }
            }
            if (n == q) res = "YES";
            System.out.println(res);
        }
    }
}


import java.util.Scanner;

public class fancyFence {
    public static void main(String[]args){
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        for (int i = 0; i <n ; i++) {
            double angle=input.nextDouble();
            double sides=360/(180-angle);
            if(sides==(int)sides){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class A {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String[] args) throws Exception {
        FastReader fr = new FastReader();
        int t = fr.nextInt();
        while(t-- > 0){
            int a = fr.nextInt();
            if(360%(180-a)==0){
                System.out.println("YES");
            }
            else{
                System.out.println("NO");
            }
        }
    }
}

//      aaakaeekmnnry
//      aaakaeekmnnry
//      abohotypsu
//      abohotypsu
//      aabadawyehhorst
//      aabadawyehhorst


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int casos = Integer.parseInt(scan.nextLine());
        String salida = "";

        for (int i = 0; i < casos; i++) {

            int grado = Integer.parseInt(scan.nextLine());
            int divisor = 0;
            for (int j = 1; j < grado; j++) {
                divisor = (180*(j-2))/j;
                if (divisor == grado) {
                    salida = "YES";
                    break;
                }
                else {
                    salida = "NO";

                }
            }

            System.out.println(salida);

        }
    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int casos = Integer.parseInt(scan.nextLine());
        String salida = "";

        for (int i = 0; i < casos; i++) {

            int grado = Integer.parseInt(scan.nextLine());

            double lado = 360 / (180 - (double)grado);
            int grado2 =  ((180 * ((int)lado - 2)) / (int)lado);

            if (grado2 == grado) {
                System.out.println("YES");

            } else {
                System.out.println("NO");

            }
        }

        System.out.println(salida);

    }
}


import java.util.HashSet;
import java.util.Scanner;

public final class FancyFence {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while (t-->0){
            int angle=sc.nextInt();
            float diff=180-angle;
            float sidesCount=360/diff;
            if(sidesCount==(int)sidesCount)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class FancyFence {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int numGroups = Integer.parseInt(scan.nextLine());
        for (int i = 0; i < numGroups; i++) {
            int angle = scan.nextInt();
            // ((n - 2) * 180) / n
            if (angle < 60) System.out.println("NO");
            else {
                for (int n = 2; n < Double.POSITIVE_INFINITY; n++) {
                    double intAngle = (double) ((n - 2) * 180) / n;
                    if (intAngle == angle) {
                        System.out.println("YES");
                        break;
                    } else if (intAngle  > angle) {
                        System.out.println("NO");
                        break;
                    }
                }
            }
        }
        scan.close();

    }
}


import java.util.Scanner;

public class FancyFence {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int numGroups = Integer.parseInt(scan.nextLine());
        for (int i = 0; i < numGroups; i++) {
            int angle = scan.nextInt();
            // ((n - 2) * 180) / n
            if (angle < 60) System.out.println("NO");
            else {
                for (int n = 2; n < Double.POSITIVE_INFINITY; n++) {
                    double intAngle = (double) ((n - 2) * 180) / n;
                    if (intAngle == angle) {
                        System.out.println("YES");
                        break;
                    } else if (intAngle  > angle) {
                        System.out.println("No");
                        break;
                    }
                }
            }
        }
        scan.close();

    }
}


import java.util.*;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=0;
		for(int i=0;i<a;i++)
		{
			b=sc.nextInt();
			if(360%(180-b)==0)
				System.out.println("YES");
			else
				System.out.println("NO");
		}

	}
}


import java.util.*;
import java.lang.*;

public class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		for(int i=0;i<a;i++)
		{
			int b=sc.nextInt();
			if(360%(180-b)==0)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();

        for (int i = 0; i < t; i++) {
            double a = scanner.nextInt();
            double b = 1;
            double x = 1.0 / 3.0;
            double y = a / 180;
            boolean isPossible = false;
            while (x <= y) {
                x = b / (b + 2.0);
                b++;
                if (x == y) {
                    isPossible = true;
                    break;
                }
            }
            System.out.println(isPossible ? "YES" : "NO");
        }
    }
}


import java.util.*;
public class  Main {

    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int test = sc.nextInt();
    for(int ii=0; ii<test; ii++){
        int n = sc.nextInt();
           // System.out.println((2.3)%1);
            double val = 180-n;
            double ans = 360/val;
            if(ans%1==0)
                System.out.println("YES");
            else
                System.out.println("NO");

    }

    }
}


import java.util.*;
public class  Main {

    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int test = sc.nextInt();
    for(int ii=0; ii<test; ii++){
        int n = sc.nextInt();
        if(n==1)
            System.out.println("YES");
        else {
           // System.out.println((2.3)%1);
            double val = 180-n;
            double ans = 360/val;
            if(ans%1==0)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

    }
}


import java.util.*;

public class FancyFence {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        While(t-- > 0){
            int n = sc.nextInt();
            if(360 % (180 -n) == 0)
                   System.out.println("YES");
            else
                   System.out.println("NO");
        }
    }
}


import java.util.*;

public class FancyFence {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-- > 0){
            int n = sc.nextInt();
            if(360 % (180 -n) == 0)
                   System.out.println("YES");
            else
                   System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class fancyfence {
    public static void main(String args[]){
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        for (int i=0;i<n;i++){
            int a=input.nextInt();
            for(int j=1;j<10000;j++){
                if((j-2)*((double)180/j)==a){
                    System.out.println("YES");
                    break;
                }
                if((j-2)*((double)180/j)>a){
                    System.out.println("NO");
                    break;
                }
            }
        }
    }
}


import java.util.Scanner;

public class fancyfence {
    public static void main(String args[]){
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        for (int i=0;i<n;i++){
            int a=input.nextInt();
            for(int j=1;j<10000;j++){
                if((j-2)*(180/j)==a){
                    System.out.println("YES");
                    break;
                }
                if((j-2)*(180/j)>a){
                    System.out.println("NO");
                    break;
                }
            }
        }
    }
}


import java.util.Scanner;
public class FancyFence {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int t = input.nextInt();
        while (t>0){
            int x = input.nextInt();
            double z = 0;
            double i = 2;
            int f = 0;
            while (z < x){
            z = (180*(i-2)/(i));
            if(z == x)
                f++;
            i++;
            }
            if(f > 0)
                System.out.println("YES");
            else
                System.out.println("NO");
            t--;
        }
    }
}


import java.util.Scanner;
public class FancyFence {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int t = input.nextInt();
        while (t>0){
            int x = input.nextInt();
            double z = 0;
            double i = 2;
            int f = 0;
            while (z < x){
            z = (180*(i-2)/(i));
            if(z == x)
                f++;
            i++;
            t--;
            }
            if(f > 0)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}


import java.util.*;

public class div {
    private static Scanner sc = new Scanner(System.in);
    private static Map<Integer, Integer> m = new TreeMap<>();
    private static long sum = 0;

    public static void main(String[] args) {
       int t = sc.nextInt();

        for (int i = 0; i < t; i++) {
            int n = sc.nextInt();
            if (360 % (180 - n) == 0) {
                System.out.println("YES");
            } else System.out.println("NO");
        }

    }
}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="1802";
    // Write

        void solve()
	{
            int n=ni();
            for (int pp = 0;pp < n; pp++) {
                int a=ni();
                if(a<60){
                    System.out.println("NO");
                }
                else if(n<180){
                    System.out.println("YES");
                }
                else{
                    System.out.println("NO");
                }
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

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

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.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; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

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

	private char[] ns(int n)//char[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);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		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();
		}
	}

	private long nl()//long
	{
		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();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="1 02";
    // Write

        void solve()
	{
            int n=ni();
            for (int pp = 0;pp < n; pp++) {
                int a=ni();
                a=180-a;
                if(a==180){System.out.println("NO");continue;}
                if(360%a==0){
                    if(360/a>2){
                    System.out.println("YES");

                }else {System.out.println("NO");}
                }
                else System.out.println("NO");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

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

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.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; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

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

	private char[] ns(int n)//char[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);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		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();
		}
	}

	private long nl()//long
	{
		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();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;

public class Solution {

    InputStream is;
	PrintWriter out;
        String INPUT ="1 02";
    // Write

        void solve()
	{
            int n=ni();
            for (int pp = 0;pp < n; pp++) {
                int a=ni();
                a=180-a;
                if(a<60){System.out.println("NO");continue;}
                if(360%a==0){
                    if(360/a>2){
                    System.out.println("YES");

                }else {System.out.println("NO");}
                }
                else System.out.println("NO");
            }
        }

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

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

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.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; }

	private double nd()//whole line double
        { return Double.parseDouble(ns()); }
	private char nc()//char
        { return (char)skip(); }

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

	private char[] ns(int n)//char[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);
	}

	private char[][] nm(int n, int m)// char[n][m]
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)//array
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()//int
	{
		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();
		}
	}

	private long nl()//long
	{
		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();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.util.Scanner;

public class a270 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n=sc.nextInt();
        for(int i=0;i<n;i++)
        {
            int s=sc.nextInt();
            if(360%(180-s)==0)
            {
                System.out.println("YES");
            }
            else
            {
                System.out.println("NO");
            }
        }
    }

}


import java.util.*;
import java.io.*;
public class Q_270A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new InputStreamReader(System.in));

        int t = sc.nextInt();
        float angles[] = new float[180];
        for(int i=2;i<180;i++) angles[i] = (float)(i-2)*180/i;
        // for(float temp : angles) System.out.println(temp +" ");

        while(t-- > 0){
            int a = sc.nextInt();
            boolean found = false;
            for(int i=0; i<180; i++){
                if(a == (int)angles[i]){
                    found=true;
                    break;
                }
            }
            if(found) System.out.println("YES");
            else System.out.println("NO");
        }

    }
}


import java.util.*;
import java.io.*;
public class Q_270A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new InputStreamReader(System.in));

        int t = sc.nextInt();
        float angles[] = new float[180];
        for(int i=2;i<180;i++) angles[i] = (float)(i-2)*180/i;
        // for(float temp : angles) System.out.println(temp +" ");

        while(t-- > 0){
            int a = sc.nextInt();
            boolean found = false;
            for(int i=0; i<180; i++){
                if (a == 178 || a == 179)found = true;
                else if(a == (int)angles[i] && angles[i] - (int)angles[i] == 0) found=true;
                if(found) break;
            }
            if(found) System.out.println("YES");
            else System.out.println("NO");
        }

    }
}


import java.util.*;
import java.io.*;
public class Q_270A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new InputStreamReader(System.in));

        int t = sc.nextInt();
        float angles[] = new float[180];
        for(int i=2;i<180;i++) angles[i] = (float)(i-2)*180/i;
        // for(float temp : angles) System.out.println(temp +" ");

        while(t-- > 0){
            int a = sc.nextInt();
            boolean found = false;
            for(int i=0; i<180; i++){
                if (a == 178 || a == 179)found = true;
                else if(a==173) break;
                else if(a == (int)angles[i]) found=true;
                if(found) break;
            }
            if(found) System.out.println("YES");
            else System.out.println("NO");
        }

    }
}


import java.util.*;
import java.io.*;
public class Q_270A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(new InputStreamReader(System.in));

        int t = sc.nextInt();
        float angles[] = new float[180];
        for(int i=2;i<180;i++) angles[i] = (float)(i-2)*180/i;
        // for(float temp : angles) System.out.println(temp +" ");

        while(t-- > 0){
            int a = sc.nextInt();
            boolean found = false;
            for(int i=0; i<180; i++){
                if (a == 178 || a == 179)found = true;
                else if(a == (int)angles[i]) found=true;
                if(found) break;
            }
            if(found) System.out.println("YES");
            else System.out.println("NO");
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastReader f = new FastReader();

        int t = f.nextInt();

        while (t-- > 0) {
            int a = f.nextInt();
            a = 180 - a;

            System.out.println(360 % a == 0 ? "YES" : "NO");
        }

    }

    //fast input reader
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

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

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int T= sc.nextInt();

		for (int i =0; i<T; i++)
		{
		   int n= sc.nextInt();
		   if( 360%(180-n)==0){
		       System.out.println("YES");
		   }
		   else{
		       System.out.println("NO");
		   }
		}

	}
}


//package com.example.myPackage;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class C {
    private static FastScanner fs = new FastScanner();
    public static void main(String[] args) {
        int t = fs.nextInt();
        while(t-->0)
        {

            int n = fs.nextInt();
            if(360 % (180-n)==0)
                System.out.println("YES");
            else System.out.println("NO");

        }
    }

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

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

        int nextInt() {
            return Integer.parseInt(next());
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


//package com.example.myPackage;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class C {
    private static FastScanner fs = new FastScanner();
    public static void main(String[] args) {
        int t = fs.nextInt();
        while(t-->0)
        {

            int n = fs.nextInt();
            nice:
            {
                for (int i = 3; i < 100; i++) {
                    if ((i - 2) * 180 / i == n) {
                        System.out.println("YES");
                        break nice;
                    }
                }
                System.out.println("NO");
            }

        }
    }

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

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

        int nextInt() {
            return Integer.parseInt(next());
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


//package com.example.myPackage;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class C {
    private static FastScanner fs = new FastScanner();
    public static void main(String[] args) {
        int t = fs.nextInt();
        while(t-->0)
        {

            int n = fs.nextInt();
            nice:
            {
                for (int i = 3; i < 1000; i++) {
                    if ((i - 2) * 180 / i == n) {
                        System.out.println("YES");
                        break nice;
                    }
                }
                System.out.println("NO");
            }

        }
    }

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

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

        int nextInt() {
            return Integer.parseInt(next());
        }

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

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class main {
    static StringBuilder out=new StringBuilder();
    static FastReader in=new FastReader();
    public static int[] getIntArray(int n){
        int arr[]=new int[n];
        for(int i=0;i<n;i++){
            arr[i]=in.nextInt();
        }
        return arr;
    }

    static int  m=(int)1e9 +7;
    static int [][]dp;

    public static int dc(int n){
        if(n==1)return 1;
        int ans=2;
        for(int i=2;i<Math.sqrt(n);i++){
            if(n%i==0)ans+=2;
        }
        if(Math.pow((int)Math.sqrt(n), 2)==n){
            ans++;
        }
        return ans;
    }
    public static void solve(){
        int a=in.nextInt();
        a=180-a;
        if(360%a==0){
            out.append("YES");
        }else{
            out.append("NO");
        }
    }

    public static void main(String args[]){
        int t=in.nextInt();
        while(t-->0){
            solve();
            out.append('\n');
        }
        System.out.println(out);
    }
}

class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

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

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }
}


import java.util.Scanner;

public class FancyFence {
    private static Scanner s = new Scanner(System.in);

    public static void main(String[] args) {
        int T = s.nextInt();
        for(int z=0;z<T;z++){
            int angle = s.nextInt();
            int ExteriorAngle = 180 - angle;
            if( 360 % ExteriorAngle == 0){
                System.out.println("YES");
            }
            else System.out.println("NO");

        }
    }
}


import java.util.Scanner;
public class Fence270A{
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for(int i=0; i<t; i++){
            int a = in.nextInt();
        if(360%(180-a)==0){
            System.out.print("YES");
        }else{
            System.out.print("NO");
        }
    }
}


import java.util.Scanner;
public class Epic119A{
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for(int i=0; i<t; i++){
            int a = in.nextInt();
            if(360%(180-a)==0){
                System.out.print("YES");
            }else{
                System.out.print("NO");
            }
        }
    }
}


import java.util.Scanner;
public class Epic119A{
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for(int i=0; i<t; i++){
            int a = in.nextInt();
            if(360%(180-a)==0){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}


import java.util.*;

import java.io.*;

public class S270{
	public static void main(String[] args) throws Exception {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
         while(t-->0){
         	int n=sc.nextInt();
         	int k=3;
         	int ans=360/(180-n);

         	if(ans>=k){
         		System.out.println("YES");
         	}

         		else{
         			System.out.println("NO");

         		}
         	}
         }
     }


import java.util.*;

import java.io.*;

public class S270{
	public static void main(String[] args) throws Exception {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
         while(t-->0){
         	int n=sc.nextInt();
         	int k=3;
         	int ans=360%(180-n);

         	if(ans==0){
         		System.out.println("YES");
         	}

         		else{
         			System.out.println("NO");

         		}
         	}
         }
     }