Petr has just bought a new car. He's just arrived at the most known Petersburg's petrol station to refuel it when he suddenly discovered that the petrol tank is secured with a combination lock! The lock has a scale of 360 degrees and a pointer which initially points at zero:

<image>

Petr called his car dealer, who instructed him to rotate the lock's wheel exactly n times. The i-th rotation should be a_i degrees, either clockwise or counterclockwise, and after all n rotations the pointer should again point at zero.

This confused Petr a little bit as he isn't sure which rotations should be done clockwise and which should be done counterclockwise. As there are many possible ways of rotating the lock, help him and find out whether there exists at least one, such that after all n rotations the pointer will point at zero again.

Input

The first line contains one integer n (1 ≤ n ≤ 15) — the number of rotations.

Each of the following n lines contains one integer a_i (1 ≤ a_i ≤ 180) — the angle of the i-th rotation in degrees.

Output

If it is possible to do all the rotations so that the pointer will point at zero after all of them are performed, print a single word "YES". Otherwise, print "NO". Petr will probably buy a new car in this case.

You can print each letter in any case (upper or lower).

Examples

Input


3
10
20
30


Output


YES


Input


3
10
10
10


Output


NO


Input


3
120
120
120


Output


YES

Note

In the first example, we can achieve our goal by applying the first and the second rotation clockwise, and performing the third rotation counterclockwise.

In the second example, it's impossible to perform the rotations in order to make the pointer point at zero in the end.

In the third example, Petr can do all three rotations clockwise. In this case, the whole wheel will be rotated by 360 degrees clockwise and the pointer will point at zero again.
import java.io.*;
import java.util.*;
import java.lang.Math;

public class Main{
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}
	static String nexts() throws IOException {
	  	  tokenizer = new StringTokenizer(reader.readLine());
	   	 String s="";
	   	 while (tokenizer.hasMoreTokens()) {
			s+=tokenizer.nextElement()+" ";
		}
		return s;
	}
	public static int gcd(int x, int y){
		if (y == 0) return x; else return gcd(y, x % y);
	}

	public static boolean isPrime(int nn) 
	    { 
	         if(nn<=1){
		 return false; }
	        if(nn<=3){
		 return true; }
	      if (nn%2==0||nn%3==0){
		 return false; }
	        for (int i=5;i*i<=nn;i=i+6){ 
	            if(nn%i==0||nn%(i+2)==0){
	            	return false;  }
	            }
	         return true; 
	    } 

	public static void shuffle(int[] A) {
		for (int i = 0; i < A.length; i++) {
			int j = (int)(i * Math.random());
			int tmp = A[i];
			A[i] = A[j];
			A[j] = tmp;
		}
	}
	public static void shufflel(Long[] A) {
		for (int i = 0; i < A.length; i++) {
			int j = (int)(i * Math.random());
			long tmp = A[i];
			A[i] = A[j];
			A[j] = tmp;
		}
	}

	public static String reverse(String input)
 	   {
	        StringBuilder input2=new StringBuilder();
	        input2.append(input);
	        input2 = input2.reverse();
	        return input2.toString();
	    }


	 public static long power(int x, long n)
	{
	//    long mod = 1000000007;
		if (n == 0) {
			return 1;
		}

		long pow = power(x, n / 2);

		if ((n & 1) == 1) {
			return (x * pow * pow);
		}
		return (pow * pow);
	}
	public static long power(long x, long y, long p)     //x^y%p
	    { 
  	       long res = 1; 
	       x = x % p; 
  	       while (y > 0) { 
 	 	 if (y % 2 == 1) {
      	        	        res = (res * x) % p; 
		 }
  		 y = y >> 1; // y = y/2 
     	     	 x = (x * x) % p; 
     	         } 
  	         return res; 
    	} 

	 static long ncr(int n, int k)  
   	 { 
           		 long res = 1; 
  		   // Since C(n, k) = C(n, n-k)  
 		       if (k > n - k) { 
     		       k = n - k; 
      		  } 
  		  // Calculate value of [n*(n-1)*---*(n-k+1)] / [k*(k-1)*---*1]  
     		   for (int i = 0; i < k; ++i) { 
        		    res *= (n - i); 
         		   res /= (i + 1); 
     		   } 
  		  return res; 
 	   }
	public static int inv(int a, int m)     //Returns modulo inverse of a with respect to m using extended euclid algorithm
	    { 
	        int m0=m,t,q; 
	        int x0=0,x1=1; 
      	        if(m==1){
	                return 0; }
                 	         while(a>1) 
     	        {  
   	                q=a/m; 
    	                t=m; 
                                 m=a%m;a=t; 
    	                t=x0; 
     	                x0=x1-q*x0; 
      	                x1=t; } 
    	          if(x1<0){
 	   	 x1+=m0; }
   	           return x1; 
	    } 

	static int modInverse(int n, int p) 
  	{ 
    	          return (int)power((long)n, (long)(p - 2),(long)p); 
	 } 
	static int ncrmod(int n, int r, int p) 
   	 { 
	        if (r == 0)        // Base case 
	            return 1; 
  	        int[] fac = new int[n + 1];         // Fill factorial array so that we can find all factorial of r, n and n-r 
	        fac[0] = 1; 
	        for (int i = 1; i <= n; i++) 
                                     fac[i] = fac[i - 1] * i % p; 
   	         return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;     //IMPORTANT
    	}	 

	static int upper(int a[], int x)   //Returns rightest index of x in sorted arr else -1
  	  {                                                //If not present returns index of just smaller element
  	            int n=a.length;
    	        int l=0;
                int r=n-1;
                int ans=-1;
                while(l<=r){
                    int m=(r-l)/2+l;
                    if(a[m]<=x){
                        ans=m;
                        l=m+1;
                    }
                    else{
                        r=m-1;
                    }
                }
                 return ans;  
                } 
	static int lower(int a[], int x)     //Returns leftest index of x in sorted arr else n
 	   {                                                  //If not present returns index of just greater element
 	            int n=a.length;
   	            int l=0;
                int r=n-1;
                int ans=n;
                while(l<=r){
                    int m=(r-l)/2+l;
                    if(a[m]>=x){
                        ans=m;
                        r=m-1;
                    }
                    else{
                         l=m+1;
                    }
                }
                 return ans; 
                 } 

	public static long stringtoint(String s){ // Convert bit string to number
		long a = 1;
		long ans = 0;
		StringBuilder sb = new StringBuilder();
		sb.append(s);  
		sb.reverse();
		s=sb.toString();
		for(int i=0;i<s.length();i++){
			ans = ans + a*(s.charAt(i)-'0');
			a = a*2;
		}
		return ans;
	}
 
	String inttostring(long a,long m){        // a is number and m is length of string required
		String res = "";                     // Convert a number in bit string representation
		for(int i=0;i<(int)m;i++){
			if((a&(1<<i))==1){
				res+='1';
			}else
				res+='0';
		}
		StringBuilder sb = new StringBuilder();
		sb.append(res);  
		sb.reverse();
		res=sb.toString();
		return res;
    }
	
	 static class R implements Comparable<R>{
	        int x, y;
	        public  R(int x, int y) {           //a[i]=new R(x,y);
	            this.x = x;
	            this.y = y;
	        }
	        public int compareTo(R o) {
            		return x-o.x;     //Increasing order(Which is usually required)
        		}
	    }   
/*   FUNCTION TO SORT HASHMAP ACCORDING TO VALUE
//USE IT AS FOLLOW	

//Make a new list
List<Map.Entry<Integer, Integer> > list = 
               new LinkedList<Map.Entry<Integer, Integer> >(h.entrySet()); 
  
        // Sort the list 
        Collections.sort(list, new Comparator<Map.Entry<Integer, Integer> >() { 
            public int compare(Map.Entry<Integer, Integer> o1,  
                               Map.Entry<Integer, Integer> o2) 
            { 
                return (o1.getValue()).compareTo(o2.getValue());     //This is used to sort string stored as VALUE, use below function here accordingly
            } 
        }); 
          
        // put data from sorted list to new hashmap  
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>(); 
        for (Map.Entry<String, Integer> aa : list) { 
            temp.put(aa.getKey(), aa.getValue()); 
        } 
        return temp;   //Now temp is our new sorted hashmap
OR
	for(int i = 0;i<h.size();i++)  //accessing elements from the list made
		{
			int count = list.get(i).getValue();    //Value
			while(count >= 0)
			{
					int key=list.get(i).getKey();  //key
					count -- ;
			}
		}

////////////////////////////////////////////////////////////////////////////////////////
public int compare(Entry<Integer, Integer> o1, Entry<Integer, Integer> o2) 
	{
		if(o1.getValue() != o2.getValue())
			return o1.getValue() > o2.getValue()?1:-1;  //Sorts Value in increasing order
		else if(o1.getValue() == o2.getValue()){
			return o1.getKey() > o2.getKey() ? 1:-1;  //If value equal, then sorts key in increasing order
		}
		
		return Integer.MIN_VALUE;
	}
*/
//Check if palindrome string - System.out.print(A.equals(new StringBuilder(A).reverse().toString())?"Yes":"No");
	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}
	
	private static void solve() throws IOException {
	//	int t = nextInt();
	//	while(t-->0){
			//String s= nextToken();
			//String[] s = str.split("\\s+");
			//ArrayList<Integer> ar=new ArrayList<Integer>();
			//HashSet<Integer> set=new HashSet<Integer>();
			//HashMap<Integer,String> h=new HashMap<Integer,String>();
			//R[] a1=new R[n];
			//char[] c=nextToken().toCharArray();
			//PriorityQueue<Integer> pq=new PriorityQueue<Integer>(Collections.reverseOrder());
			//NavigableSet<Integer> pq=new TreeSet<>();
			int n = nextInt();
			//long n = nextLong();
			
			int[] a=new int[n];
			//long[] a=new long[n];
			int t=0;
			for(int i=0;i<n;i++){
				a[i]=nextInt();
				t+=a[i];
			}
			if(t%360==0){
			    writer.println("YES");
			    return;
			}
			//t=0;
			//for(int i=0;i<n;i++)
			if(t%2==1){
			    writer.println("NO");
			    return;
			}
			t=0;
		//	writer.println(t);
			boolean[][] dp=new boolean[n+1][t+1];
			for(int i=0;i<=n;i++)dp[i][0]=true;
			//for(int i=1;i<=t;i++)dp[0][i]=false;
			for(int i=1;i<=n;i++){
			    for(int j=1;j<=t;j++){
			        if(a[i-1]<=j){
			            dp[i][j]=dp[i-1][j]||dp[i-1][j-a[i-1]];
			        }
			        else dp[i][j]=dp[i-1][j];
			    }
			}
			if(dp[n][t]){writer.println("YES");return;}
			t=360;
		//	writer.println(t);
			boolean[][] dpp=new boolean[n+1][t+1];
			for(int i=0;i<=n;i++)dpp[i][0]=true;
			//for(int i=1;i<=t;i++)dp[0][i]=false;
			for(int i=1;i<=n;i++){
			    for(int j=1;j<=t;j++){
			        if(a[i-1]<=j){
			            dpp[i][j]=dpp[i-1][j]||dpp[i-1][j-a[i-1]];
			        }
			        else dpp[i][j]=dpp[i-1][j];
			    }
			}
			//shuffle(a);
			//shufflel(a);
			//Arrays.sort(a);
			//StringBuilder ans=new StringBuilder();
			int s=0;
// 			for(int i=0;i<=n;i++){
// 			    for(int j=0;j<=t;j++){
// 			        writer.print(dp[i][j]+" ");
// 			    }
// 			    writer.println();
// 			}
// 			for(int j=1;j<=n;j++){
// 			    if(dp[j][t])s+=a[j-1];
// 			}
            if(dpp[n][t])writer.println("YES");
            //else if(s>=360&&s%360==0)writer.println("YES1");
            else writer.println("NO");
			
		// }
	}
}