
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.TreeSet;
import java.lang.Integer;

public class fence_kp_java {

    static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    static int nextInt() {
        try {
            st.nextToken();
            return (int) st.nval;
        } catch (IOException ex) {
            return 0;
        }
    }


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