#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int t,a;
cin>>t;
while(t--)
{
cin>>a;
if(360%(180-a)==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}
Need to know: the sum of the exterior angles of a polygon is 360°, and the interior angle of a regular polygon cannot be less than 30°