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:  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.

The first line contains one integer $$$n$$$ ($$$1 \leq n \leq 15$$$) — the number of rotations. Each of the following $$$n$$$ lines contains one integer $$$a_i$$$ ($$$1 \leq a_i \leq 180$$$) — the angle of the $$$i$$$-th rotation in degrees.

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).

NoteIn 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.util.Scanner;
import java.util.HashSet;
import java.util.Collections;
import java.util.ArrayList;

public class Main{
    public static void main(String[] args)
    {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
          int[]a = new int[n];
          for(int i=0;i<n;i++)
          {
              int num = scn.nextInt();
              a[i]=num;
          }
          if(istrue(a,0,0))
          {
              System.out.println("YES");
          }else{
              System.out.println("NO");
          }

    }
    public static boolean istrue(int[]a,int idx,int sum)
    {
        if(a.length==idx)
        {
            if(sum%360==0)
            {
                return true;
            }else{
                return false;
            }
        }
        if(istrue(a,idx+1,sum+a[idx]))
        {
            return true;
        }

        if(istrue(a,idx+1,sum-a[idx]))
          return true;

          return false;
    }
}

import java.util.Scanner;

public class Solution {

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

        for (int i = 0; i < N; i++) {
            w[i] = in.nextInt();
        }

        for (int i = 0; i < (1 << N); i++) {
            int sum = 0;
            for (int j = 0; j < N; j++) {
                if ((i & (1 << j)) == 0) {
                    sum += w[j];
                } else {
                    sum -= w[j];
                }
            }

            if (sum % 360 == 0) {
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class BPetrAndACombinationLock {
    static class Solution {
        int[]mat = {1, -1};
        //Boolean[][]dp;
        //Map<String, Boolean> map;
        public void find(int[] arr) {
            //map = new HashMap();
            boolean res = possible(arr, 0, 0);
            System.out.println(res==true? "YES" : "NO");
        }

        boolean possible(int[] arr, int index, int sum) {
            if(index == arr.length) {
                if(sum%360 == 0) {
                    return true;
                }
                return false;
            }

            //String key = index + "/" + sum;

            //if(map.containsKey(key)) return map.get(key);
            for(int i=0; i<2; i++) {
                if(possible(arr, index+1, sum+(arr[index]*mat[i]))) {
                    //map.put(key, true);
                    return true;
                }
            }
            //map.put(key, false);
            return false;
        }
    }

    public static void main(String[] args) {
        Solution sol = new Solution();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }
        sol.find(arr);
    }
}

//Java Program for Combination Lock
import java.util.*;
public class Combination
{

	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int totalrotations=s.nextInt();
	  int degree[]=new int[totalrotations];
	  boolean isPossible=false;
	  for(int i=0;i<totalrotations;i++)
	  {
	    degree[i]=s.nextInt();
	  }
	  int combinations=(int)Math.pow(2,totalrotations);
	  for(int i=0;i<combinations;i++)
	  {
		int finall=0;
		for(int j=0;j<totalrotations;j++)
		{
		  if((i & (1<<j))==0)
		  {
			finall-=degree[j];
		  }
		  else
		  {
		       finall+=degree[j];
		  }
		}
		//System.out.println(finall);
		if(finall%360==0)
		{isPossible=true;break;}

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

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Solution{
    static int[] a = new int[16];
    static int n;
    static boolean ans = false;
    static void solve(int idx, int rotation) {
        if (idx == n) {
            if (rotation % 360 == 0) {
                ans = true;
            }
            return;
        }
        solve(idx + 1, rotation + a[idx]);
        solve(idx + 1, rotation - a[idx]);
    }
    public static void solve(InputReader in, OutputWriter out) {
        n = in.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        solve(0, 0);
        out.println(ans ? "YES" : "NO");
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        solve(in, out);
        out.flush();
    }
}
class Pair
{
    int x;
    int h;
    Pair(int x, int h)
    {
        this.x = x;
        this.h = h;
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            if (Character.isValidCodePoint(c)) {
                res.appendCodePoint(c);
            }
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0) {
            s = readLine0();
        }
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return readLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1) {
            read();
        }
        return value == -1;
    }

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

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
    public int[] nextIntArray(int n){
        int[] array=new int[n];
        for(int i=0;i<n;++i)array[i]=nextInt();
        return array;
    }
    public int[] nextSortedIntArray(int n){
        int array[]=nextIntArray(n);
        Arrays.sort(array);
        return array;
    }
    public int[] nextSumIntArray(int n){
        int[] array=new int[n];
        array[0]=nextInt();
        for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
        return array;
    }
    public long[] nextLongArray(int n){
        long[] array=new long[n];
        for(int i=0;i<n;++i)array[i]=nextLong();
        return array;
    }
    public long[] nextSumLongArray(int n){
        long[] array=new long[n];
        array[0]=nextInt();
        for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
        return array;
    }
    public long[] nextSortedLongArray(int n){
        long array[]=nextLongArray(n);
        Arrays.sort(array);
        return array;
    }
}
class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(char[] array) {
        writer.print(array);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void print(double[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void print(long[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void println(int[] array) {
        print(array);
        writer.println();
    }

    public void println(double[] array) {
        print(array);
        writer.println();
    }

    public void println(long[] array) {
        print(array);
        writer.println();
    }

    public void println() {
        writer.println();
    }

    public void println(Object... objects) {
        print(objects);
        writer.println();
    }

    public void print(char i) {
        writer.print(i);
    }

    public void println(char i) {
        writer.println(i);
    }

    public void println(char[] array) {
        writer.println(array);
    }

    public void printf(String format, Object... objects) {
        writer.printf(format, objects);
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

    public void print(long i) {
        writer.print(i);
    }

    public void println(long i) {
        writer.println(i);
    }

    public void print(int i) {
        writer.print(i);
    }

    public void println(int i) {
        writer.println(i);
    }

    public void separateLines(int[] array) {
        for (int i : array) {
            println(i);
        }
    }
}

import java.util.*;
import java.io.*;
import java.net.URI;
public class b{

 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;
        }
    }

    static boolean f(int [] a,int n,int sum){
        if(n==0)return sum==0 || sum%360==0;
        boolean aa=f(a,n-1,sum-a[n-1]);
        boolean bb=f(a,n-1,sum+a[n-1]);
        return aa||bb;

    }
    public static void main(final String [] args)throws IOException{
       FastReader sc=new FastReader();

        int n=sc.nextInt();
        int [] a=new int[n];
        for(int i=0;i<n;i++){a[i]=sc.nextInt();}
        if(f(a,n,0)){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }

    }
}

import java.util.Scanner;

public class PetrePetrolLock {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }
        int pow = (int) (Math.pow(2, n));
        for(int i=0;i<pow;i++){
            String bits = Integer.toBinaryString(i);
            if(bits.length()!=n){
                int diff = n-bits.length();
                while(diff-->0){
                    bits="0"+bits;
                }
            }
            //System.out.println(bits);
            int j;
            long sum=0;
            for(j=0;j<n;j++){
                if(bits.charAt(j)=='1'){
                    sum+=arr[j];
                }else{
                    sum-=arr[j];
                }
                //System.out.print(sum);
            }
            //System.out.println();
            if(sum==0 || sum%360==0){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}

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

public class CF_1097B {
    private static int count;

    public static void solve(ArrayList<Integer> arr, int currentIndex, int currentMeasure) {
//        System.out.println(currentIndex + " " + arr.size());
        if (currentMeasure < 360) {
            currentMeasure = 360 - currentMeasure;
        }
        if (currentMeasure >= 360) {
            currentMeasure %= 360;
        }
        if (currentIndex != arr.size() ) {
            solve(arr, currentIndex + 1, (currentMeasure + arr.get(currentIndex)) % 360);
            solve(arr, currentIndex + 1, (currentMeasure - arr.get(currentIndex)) % 360);
        } else {
            if(currentMeasure==0)
                count++;
//            System.out.println(currentMeasure);
        }
    }

    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int numberOfRotations = in.nextInt();
        ArrayList<Integer> arr = new ArrayList<>();
        for (int i = 0; i < numberOfRotations; i++) {
            int current = in.nextInt();
            arr.add(current);
        }
        solve(arr, 0, 0);
        if(count>0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}

import java.util.*;
public class petr {
    public static void main(String[] args) {
        Scanner iangay = new Scanner(System.in);
        int[] degrees = new int[iangay.nextInt()];
        for (int i = 0; i < degrees.length; i++) { degrees[i] = iangay.nextInt(); }
        boolean isCombo = false;
        for (int i = 0; i < Math.pow(2, degrees.length) - 1; i++) {
            int total = 0;
            StringBuilder combo = new StringBuilder(Integer.toBinaryString(i));
            combo.append(String.join("", Collections.nCopies(degrees.length - combo.length(), "0")));
            for (int j = 0; j < degrees.length; j++) {
                if (combo.charAt(j) == '1') { total += degrees[j]; }
                else { total -= degrees[j]; }
            }
            if (total % 360 == 0) { isCombo = true; break; }
        }
        if (isCombo) { System.out.println("YES"); }
        else { System.out.println("NO"); }
    }
}

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

public class P1097B1200 {
    public static void main(String[] args) throws IOException {
        BufferedReader bread = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        int n = Integer.parseInt(bread.readLine());
        int[] degrees = new int[n];
        for(int i= 0; i < n; i++){
            degrees[i] = Integer.parseInt(bread.readLine());
        }
        boolean answer = possible(0, degrees, 0);
        if(answer){
            out.println("YES");
        }
        else{
            out.println("NO");
        }
        out.close();
    }

    public static boolean possible(int cumSum, int[] degrees, int index){
        if(index == degrees.length){
            if(cumSum % 360 == 0)
                return true;
            return false;
        }
        return possible(cumSum + degrees[index], degrees, index + 1) ||
                possible(cumSum - degrees[index], degrees, index + 1);
    }
}

// package b;

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

public class CF1097_Petr_And_combination_Lock implements Closeable {
    static String filePath = "/home/bishoy/IdeaProjects/Arabic competetive programming/src/b/test";
    BufferedReader inputReader = new Helper().readInput(Helper.STD, filePath);
    PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

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

        CF1097_Petr_And_combination_Lock c = new CF1097_Petr_And_combination_Lock();
        c.solve2();
        c.close();
    }

    public void solve2() throws IOException {
        int n = nextInt();
        arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        if (ffff(0, 0))
            writer.println("yes");
        else
            writer.println("no");

    }

    int arr[];

    //left [0], right sum [1];
    int mem[][] = new int[2][360];
    boolean possible = false;

    boolean ffff(int sum, int i) {

        if (i == arr.length) {
            if (sum == 0 || sum % 360 == 0)
                return true;
            else
                return false;
        }

        boolean s1 = ffff(arr[i] + sum, i + 1);
        boolean s2 = ffff(-arr[i] + sum, i + 1);
        if (s1 || s2)
            return true;

        return false;
    }

    int findSum(int sum, int i) {

        if (i == arr.length) {
            return sum;
        }

        return 0;
    }

    StringTokenizer stringTokenizer;

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            stringTokenizer = new StringTokenizer(inputReader.readLine());
        }
        return stringTokenizer.nextToken();
    }

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

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

    int[] nextIntArr(int n) throws IOException {
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    long[] nextLongArr(int n) throws IOException {
        long arr[] = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextLong();
        }
        return arr;
    }

    @Override
    public void close() throws IOException {
        inputReader.close();
        writer.close();
    }

    static class Helper {
        BufferedReader inputReader = null;
        PrintWriter out = null;
        public static final int FILE = 0;
        public static final int STD = 1;

        public static class Pair<K, V> {
            public K key;
            public V value;

            public Pair(K key, V value) {
                this.key = key;
                this.value = value;
            }

            @Override
            public String toString() {
                return "( " + key + " , " + value + ")";
            }
        }

        public BufferedReader readInput(int type, String filePath) {
            if (type == FILE) {
                try {
                    inputReader = new BufferedReader(
                            new InputStreamReader(new FileInputStream(filePath)));
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                }
            } else
                inputReader = new BufferedReader(new InputStreamReader(System.in));

            return inputReader;
        }

    }
}

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

public class Main {
    public static boolean possible(int [] degrees,int total,int n){
        if (total%360==0){
            total=0;
        }
        if(n<0){
            if (total==0){
                return true;
            }
            return false;
        }
        else return possible(degrees,total+degrees[n],n-1) ||
                possible(degrees,total-degrees[n],n-1);
    }

    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int [] degrees = new int[n];
        for (int i=0;i<n;i++){
            degrees[i]=scanner.nextInt();
        }
        if(possible(degrees,0,n-1)){
            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;
import java.util.*;

public class cf2 {
    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 (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
    static int modPower(int x, int y, int mod){
        int res = 1;
        x %= mod;
        if(x==0) return 0;
        while(y>0){
            if(y%2==1){
                res = (res*x)%mod;
            }
            y = y>>1;
            x = (x*x)%mod;
        }
        return res;
    }
    static class pair<T1, T2>{
        T1 first;
        T2 second;
        pair(T1 first, T2 second){
            this.first = first;
            this.second = second;
        }
    }
    static long gcd(long a, long b){
        if(b == 0) return a;
        return gcd(b, a%b);
    }

    static String populate(String s, int n){
        if(s.length() >= n) return s;
        while(s.length() < n){
            s = "0" + s;
        }
        return s;
    }

    public static void main(String[] args) {
        FastReader in = new FastReader();
        int n = in.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++) a[i] = in.nextInt();
        int mx = (int)Math.pow(2, n);
        boolean ok = false;
        for(int i = 0; i < mx; i++){
            char[] x = populate(Integer.toBinaryString(i), n).toCharArray();
            long s = 0;
            for(int j = 0; j < n; j++){
                if(x[j] == '0') s += a[j];
                else s -= a[j];
            }
            if(s % 360 == 0){
                ok = true; break;
            }
        }
        System.out.println(ok?"YES":"NO");
    }
}

import java.util.*;
public class Main {
  public static boolean result(int[] p, int q, int a, int n)
{
  if(a==n-2)
  {
    if((q+p[a+1])%360==0)
    return true;
    if((q-p[a+1])%360==0)
    return true;
    return false;
  }
  else
  {
    if(result(p,q+p[a+1],a+1,n)==true)
    return true;
    if(result(p,q-p[a+1],a+1,n)==true)
    return true;
    return false;
  }
}
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    int n = s.nextInt();
    int[] k = new int[n];
    for(int i=0;i<n;i++)
    {
      k[i]=s.nextInt();
    }
    if(n==1)
    {
        if(k[0]%360==0)
        System.out.println("YES");
        else
        System.out.println("NO");
        return;
    }
    if(Main.result(k,k[0],0,n)==true)
    System.out.println("YES");
    else
    System.out.println("NO");
  }
}

import java.io.*;
import java.util.ArrayDeque;
import java.util.Random;
import java.util.StringTokenizer;

public class F {
    //Solution by Sathvik Kuthuru
    public static void main(String[] args) {
        FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        Task solver = new Task();
        int t = 1;
        for(int tt = 1; tt <= t; tt++) solver.solve(tt, scan, out);
        out.close();
    }

    static class Task {
        int n;
        int[] a;
        boolean[][] visited;

        public void solve(int testNumber, FastReader scan, PrintWriter out) {
            n = scan.nextInt();
            a = new int[n];
            visited = new boolean[n][360];
            for(int i = 0; i < n; i++) a[i] = scan.nextInt();
            ArrayDeque<Integer> queue = new ArrayDeque<>();
            queue.addLast(0);
            queue.addLast(0);
            visited[0][0] = true;
            while(!queue.isEmpty()) {
                int at = queue.pollFirst(), curr = queue.pollFirst();
                int f = curr + a[at], s = curr - a[at];
                if(f >= 360) f -= 360;
                if(s < 0) s += 360;
                if(at + 1 == n) {
                    if(f == 0 || s == 0) {
                        out.println("YES");
                        return;
                    }
                    continue;
                }
                if(!visited[at + 1][f]) {
                    visited[at + 1][f] = true;
                    queue.addLast(at + 1);
                    queue.addLast(f);
                }
                if(!visited[at + 1][s]) {
                    visited[at + 1][s] = true;
                    queue.addLast(at + 1);
                    queue.addLast(s);
                }
            }
            out.println("NO");
        }
    }

    static void shuffle(int[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            int temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static void shuffle(long[] a) {
        Random get = new Random();
        for (int i = 0; i < a.length; i++) {
            int r = get.nextInt(a.length);
            long temp = a[i];
            a[i] = a[r];
            a[r] = temp;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

        public FastReader(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(new File(s)));
        }

        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.io.*;
import java.math.BigInteger;
import java.util.*;

public class Solution{
    static int[] a = new int[16];
    static int n;
    static boolean ans = false;
    static void solve(int idx, int rotation) {
        if (idx == n) {
            if (rotation % 360 == 0) {
                ans = true;
            }
            return;
        }
        solve(idx + 1, rotation + a[idx]);
        solve(idx + 1, rotation - a[idx]);
    }
    public static void solve(InputReader in, OutputWriter out) {
        n = in.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        //1 - anti and 0 - clock
        for(int i=0;i<(1<<n);i++)
        {
            int ans = 0;
            for(int j=0;j<n;j++){
                if(((i>>j)&1)==1)
                    ans-=a[j];
                else
                    ans+=a[j];
            }
            if(ans % 360 == 0){
                out.println("YES");
                return;
            }
        }
        out.println("NO");
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        solve(in, out);
        out.flush();
    }
}
class Pair
{
    int x;
    int h;
    Pair(int x, int h)
    {
        this.x = x;
        this.h = h;
    }
}
class InputReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            if (Character.isValidCodePoint(c)) {
                res.appendCodePoint(c);
            }
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0) {
            s = readLine0();
        }
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return readLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1) {
            read();
        }
        return value == -1;
    }

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

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
    public int[] nextIntArray(int n){
        int[] array=new int[n];
        for(int i=0;i<n;++i)array[i]=nextInt();
        return array;
    }
    public int[] nextSortedIntArray(int n){
        int array[]=nextIntArray(n);
        Arrays.sort(array);
        return array;
    }
    public int[] nextSumIntArray(int n){
        int[] array=new int[n];
        array[0]=nextInt();
        for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
        return array;
    }
    public long[] nextLongArray(int n){
        long[] array=new long[n];
        for(int i=0;i<n;++i)array[i]=nextLong();
        return array;
    }
    public long[] nextSumLongArray(int n){
        long[] array=new long[n];
        array[0]=nextInt();
        for(int i=1;i<n;++i)array[i]=array[i-1]+nextInt();
        return array;
    }
    public long[] nextSortedLongArray(int n){
        long array[]=nextLongArray(n);
        Arrays.sort(array);
        return array;
    }
}
class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(char[] array) {
        writer.print(array);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void print(double[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void print(long[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(array[i]);
        }
    }

    public void println(int[] array) {
        print(array);
        writer.println();
    }

    public void println(double[] array) {
        print(array);
        writer.println();
    }

    public void println(long[] array) {
        print(array);
        writer.println();
    }

    public void println() {
        writer.println();
    }

    public void println(Object... objects) {
        print(objects);
        writer.println();
    }

    public void print(char i) {
        writer.print(i);
    }

    public void println(char i) {
        writer.println(i);
    }

    public void println(char[] array) {
        writer.println(array);
    }

    public void printf(String format, Object... objects) {
        writer.printf(format, objects);
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

    public void print(long i) {
        writer.print(i);
    }

    public void println(long i) {
        writer.println(i);
    }

    public void print(int i) {
        writer.print(i);
    }

    public void println(int i) {
        writer.println(i);
    }

    public void separateLines(int[] array) {
        for (int i : array) {
            println(i);
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author dmytro.prytula
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrIKodoviiZamok solver = new BPetrIKodoviiZamok();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrIKodoviiZamok {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            int[] a = in.nextArr(n);

            int MAX = 1 << n;

            for (int i = 1; i < MAX; i++) {
                long res = 0L;
                char[] arr = GeekMath.toBitString(i, n).toCharArray();
                int k = 0;
                for (char c : arr) {
                    res += (c == '1') ? a[k] : -a[k];
                    k++;
                }
                if (res % 360 == 0) {
                    out.print("YES");
                    return;
                }
            }
            out.print("NO");
        }

    }

    static class GeekMath {
        public static String toBitString(int number, int len) {
            String bits = Integer.toString(number, 2);
            StringBuilder sb = new StringBuilder();
            for (int toPrepend = len - bits.length(); toPrepend > 0; toPrepend--) {
                sb.append('0');
            }
            sb.append(bits);
            return sb.toString();
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String nextToken() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public int[] nextArr(int size) {
            return Arrays.stream(new int[size]).map(c -> nextInt()).toArray();
        }

    }
}

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

public class Minimum_Triangulation
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw=new PrintWriter(System.out);

		int t=1;

		m:while(t-->0)
		{
			int n=Integer.parseInt(br.readLine());
			int a[]=new int[n];
			LinkedList<Integer> q=new LinkedList<>();
			LinkedList<Integer> temp=new LinkedList<>();
			q.add(0);
			for(int i=0;i<n;i++)
			{
				temp=new LinkedList<>();
				a[i]=Integer.parseInt(br.readLine());
				for(int x:q)
				{
					temp.add(x-a[i]);
					temp.add(x+a[i]);
				}
				q.clear();
				q.addAll(temp);
			}

			for(int x:q)
			{
				if(x%360==0)
				{
					pw.println("YES");
					continue m;
				}
			}
			pw.println("NO");
		}
		pw.flush();
	}
}

/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)
		a[i]=ob.nextInt();
		int f=0;
		for(int i=0;i<(1<<n);i++)
		{
		    int sum=0;
		    for(int j=0;j<n;j++)
		    {
		        if((i&(1<<j))>0)
		        {
		            sum-=a[j];
		        }
		        else
		        {
		            sum+=a[j];
		        }
		    }
		    if(sum%360==0)
		    {
		     f=1;
		     break;
		    }

		}
		if(f==1)
		System.out.println("YES");
		else
		System.out.println("NO");
	}
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.regex.*;
public class Main{
       /*  public static ArrayList a[]=new ArrayList[300001];
         public static ArrayList child[]=new ArrayList[300001];
         static boolean visited[]=new boolean [300001];*/
		static int  seg[];
		static void update(int node,int start,int end,int id) {
			if(start==end) {
				seg[node]=1;
				return ;
			}
			int mid=(start+end)/2;
			if(id>=start && id<=mid) {
				update(2*node+1,start,mid,id);
			}
			else
				update(2*node+2,mid+1,end,id);
			seg[node]=seg[2*node+1]+seg[2*node+2];
		}
		static int query(int node,int start,int end,int l,int r) {
			if(start>r || end<l)
				return 0;
			if(start>=l && end<=r)
				return seg[node];
			int mid=(start+end)/2;
			return (query(2*node+1,start,mid,l,r)+query(2*node+2,mid+1,end,l,r));
		}
         public static void main(String[] args)
        {
            InputReader in = new InputReader(System.in);
            PrintWriter pw = new PrintWriter(System.out);
            int n=in.nextInt();
            int a[]=new int[n];
            int sum=0;
            for(int i=0;i<n;i++)
            {
            	a[i]=in.nextInt();
            	sum+=a[i];
            }
           if(sum%360==0)
           {
        	   pw.println("YES");
        	   pw.flush();
        	   pw.close();
        	   System.exit(0);

           }
           for(int i=0;i<=Math.pow(2, n);i++) {
        	   long fi=0;
        	   for(int j=0;j<n;j++) {
        		   if(((i>>j)&1)==1)
        			   fi+=a[j];

        	   }
        	   if((fi-sum+fi)%360==0)
        	   {
        		   pw.println("YES");
        		   pw.flush();
            	   pw.close();
            	   System.exit(0);
        	   }

           }
           pw.println("NO");

            pw.flush();
            pw.close();

        }

		private static void debug(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
        static class InputReader
        {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }
        public int snext()
        {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars)
            {
                curChar = 0;
                try
                {
                    snumChars = stream.read(buf);
                }

                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n)
        {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = nextInt();
            }
            return a;
        }
        static class tri implements Comparable<tri> {
            int p, c, l;

            tri(int p, int c, int l) {
                this.p = p;
                this.c = c;
                this.l = l;
            }

            public int compareTo(tri o) {
                return Integer.compare(l, o.l);
            }
        }

        public String readString()
        {
            int c = snext();
            while (isSpaceChar(c))
            {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine()
        {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c)
        {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }
        public static long mod = 1000000007;
        public static int d;
        public static int p;
        public static int q;

        public static int[] suffle(int[] a,Random gen)
        {
            int n = a.length;
            for(int i=0;i<n;i++)
            {
                int ind = gen.nextInt(n-i)+i;
                int temp = a[ind];
                a[ind] = a[i];
                a[i] = temp;
            }
            return a;
        }

        public static void swap(int a, int b){
            int temp = a;
            a = b;
            b = temp;
        }

       /* public static long primeFactorization(long n)
        {
             HashSet<Integer> a =new HashSet<Integer>();
        	long cnt=0;
            for(int i=2;i*i<=n;i++)
            {
                while(a%i==0)
                {
                    a.add(i);
                    a/=i;
                }
            }
            if(a!=1)
            	cnt++;
                //a.add(n);
            return cnt;
        }*/

        public static void sieve(boolean[] isPrime,int n)
        {
            for(int i=1;i<n;i++)
                isPrime[i] = true;

            isPrime[0] = false;
            isPrime[1] = false;

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

        public static int GCD(int a,int b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static long GCD(long a,long b)
        {
            if(b==0)
                return a;
            else
                return GCD(b,a%b);
        }

        public static void extendedEuclid(int A,int B)
        {
            if(B==0)
            {
                d = A;
                p = 1 ;
                q = 0;
            }
            else
            {
                extendedEuclid(B, A%B);
                int temp = p;
                p = q;
                q = temp - (A/B)*q;
            }
        }

        public static long LCM(long a,long b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int LCM(int a,int b)
        {
            return (a*b)/GCD(a,b);
        }

        public static int binaryExponentiation(int x,int n)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static long binaryExponentiation(long x,long n)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=result * x;
                x=x*x;
                n=n/2;
            }
            return result;
        }

        public static int modularExponentiation(int x,int n,int M)
        {
            int result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result * x)%M;
                x=(x%M*x)%M;
                n=n/2;
            }
            return result;
        }

        public static long modularExponentiation(long x,long n,long M)
        {
            long result=1;
            while(n>0)
            {
                if(n % 2 ==1)
                    result=(result%M * x%M)%M;
                x=(x%M * x%M)%M;
                n=n/2;
            }
            return result;
        }

        public static long modInverse(int A,int M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static long modInverse(long A,long M)
        {
            return modularExponentiation(A,M-2,M);
        }

        public static boolean isPrime(int n)
        {

            if (n <= 1)  return false;
            if (n <= 3)  return true;

            if (n%2 == 0 || n%3 == 0)
                return false;

            for (int i=5; i*i<=n; i=i+6)
            {
                if (n%i == 0 || n%(i+2) == 0)
                   return false;
            }

            return true;
        }

         public static long[] shuffle(long[] a, Random gen){
                for(int i = 0, n = a.length;i < n;i++){
                    int ind = gen.nextInt(n-i)+i;
                    long d = a[i];
                    a[i] = a[ind];
                    a[ind] = d;
                }
                return a;
            }
        static class pair implements Comparable<pair>
        {
            Long x;
            Integer y;
            pair(long z,int sum)
            {
                this.x=z;
                this.y=sum;
            }

        public int compareTo(pair o) {
                int result = x.compareTo(o.x);
                if(result==0)
                    result = y.compareTo(o.y);

            return result;
            }

            public String toString()
            {
                return x+" "+y;
            }

            public boolean equals(Object o)
            {
                if (o instanceof pair)
                {
                    pair p = (pair)o;
                    return p.x == x && p.y == y ;
                }
                return false;
            }

            public int hashCode()
            {
                return new Long(x).hashCode()*31 + new Long(y).hashCode();
            }
        }

}
class query {
	Long x;
	Integer y,z;
	query(long x,int y,int z){
		this.x=x;
		this.y=y;
		this.z=z;
	}
}

import static java.lang.Double.parseDouble;
import static java.lang.Integer.MAX_VALUE;
import static java.lang.Integer.max;
import static java.lang.Long.max;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.abs;
import static java.lang.Math.min;
import static java.lang.Math.toRadians;
import static java.lang.System.exit;
import static java.lang.System.gc;

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class A {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    int n, a[] = new int[20];

    boolean fun(int i, int deg) {
        return i == n ? deg % 360 == 0 : fun(i + 1, deg + a[i]) || fun(i + 1, deg - a[i]);
    }

    void solve() throws Exception {
        n = nextInt();
        a = na(n);
        out.println(fun(0, 0) ? "YES" : "NO");
    }

    public int lower_bound(long[] a, long v) {
        int low = -1, high = a.length;
        while (high - low > 1) {
            int h = high + low >>> 1;
            if (a[h] >= v) {
                high = h;
            } else {
                low = h;
            }
        }
        return high;
    }

    private int gcd(int a, int b) {
        while (b > 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    private int lcm(int a, int b) {
        return a * (b / gcd(a, b));
    }

    private int[] na(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    private long[] nal(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return parseLong(next());
    }

    double nextDouble() throws IOException {
        return parseDouble(next());
    }

    String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public static void main(String[] args) throws Exception {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
            //long lStartTime = System.currentTimeMillis();
            new A().solve();
            //long lEndTime = System.currentTimeMillis();
            //out.println("Elapsed time in seconds: " + (double)(lEndTime - lStartTime) / 1000.0);
            in.close();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            exit(1);
        }
    }
}

import org.omg.PortableInterceptor.INACTIVE;

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

// author @mdazmat9
 public  class codeforces{
     static ArrayList<Integer> list=new ArrayList<>();
     static HashSet set=new HashSet();
     static int index=0;
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int test = 1;
        for (int ind = 0; ind < test; ind++) {
          int n=sc.nextInt();
          for(int i=0;i<n;i++){
              list.add(sc.nextInt());
          }
          recurse(list.get(0),1,n);
          recurse(-list.get(0),1,n);
            if(set.contains(true)){
                out.println("YES");
            }
            else{
                out.println("NO");
            }

        }
        out.flush();
    }
    public static void recurse(int sum,int k,int n){
       if(k==n){
           if(sum%360==0){
               set.add(true);
           }
           return;
       }
       int num=list.get(k);
       recurse(sum+num,k+1,n);
       recurse(sum-num,k+1,n);

    }
  public   static class Graph {
        // A user define class to represent a graph.
        // A graph is an array of adjacency lists.
        // Size of array will be V (number of vertices
        // in graph)
        int V;
        LinkedList<Integer>[] adjListArray;

        // constructor
        Graph(int V) {
            this.V = V;
            // define the size of array as
            // number of vertices
            adjListArray = new LinkedList[V];

            // Create a new list for each vertex
            // such that adjacent nodes can be stored

            for (int i = 0; i < V; i++) {
                adjListArray[i] = new LinkedList<Integer>();
            }
        }

        // Adds an edge to an undirected graph
        void addEdge(int src, int dest) {
            // Add an edge from src to dest.
            adjListArray[src].add(dest);

            // Since graph is undirected, add an edge from dest
            // to src also
            adjListArray[dest].add(src);
        }

        void DFSUtil(int v, boolean[] visited) {
            // Mark the current node as visited and print it
            visited[v] = true;
          //  System.out.print(v + " ");
            list.add(v);
            // Recur for all the vertices
            // adjacent to this vertex
            for (int x : adjListArray[v]) {
                if (!visited[x])
                    DFSUtil(x, visited);
            }
            }

        void connectedComponents() {
            // Mark all the vertices as not visited
            boolean[] visited = new boolean[V];
            for (int v = 0; v < V; ++v) {
                if (!visited[v]) {
                    // print all reachable vertices
                    // from v
                    DFSUtil(v, visited);
                    list.add(-11);
                   // System.out.println();
                }
            }
        }
    }

        private static class pair implements Comparable<pair>{
            int i;
            Long cost;

            pair(int a, Long b){
                i=a;
                cost=b;
            }

            @Override
            public int compareTo(pair o) {
                if(this.cost!=o.cost)
                    return (int)(this.cost-o.cost);
                else
                    return this.i-o.i;
            }
        }

    static   void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    static long gcd(long a , long b)
    {
        if(b == 0)
            return a;
        return gcd(b , a % b);
    }

}
class Scanner {
    public BufferedReader reader;
    public StringTokenizer st;

    public Scanner(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        st = null;
    }

    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = reader.readLine();
                if (line == null) return null;
                st = new StringTokenizer(line);
            } catch (Exception e) {
                throw (new RuntimeException());
            }
        }
        return st.nextToken();
    }

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

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

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

class OutputWriter {
    BufferedWriter writer;

    public OutputWriter(OutputStream stream) {
        writer = new BufferedWriter(new OutputStreamWriter(stream));
    }

    public void print(int i) throws IOException {
        writer.write(i);
    }

    public void print(String s) throws IOException {
        writer.write(s);
    }

    public void print(char[] c) throws IOException {
        writer.write(c);
    }

    public void close() throws IOException {
        writer.close();
    }

}

import static java.lang.Double.parseDouble;
import static java.lang.Integer.MAX_VALUE;
import static java.lang.Integer.max;
import static java.lang.Long.max;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.abs;
import static java.lang.Math.min;
import static java.lang.Math.toRadians;
import static java.lang.System.exit;
import static java.lang.System.gc;

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class A {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    int n, a[] = new int[20];
    boolean fun(int i, int deg) {
        if(deg < 0) deg += 360;
        if(deg >= 360) deg -= 360;
        if(i == n) return deg == 0;
        return fun(i+1, deg + a[i]) || fun(i+1, deg - a[i]);
    }

    void solve() throws Exception {
        n = nextInt();
        a = na(n);
        out.println(fun(0, 0) ? "YES" : "NO");
    }

    public int lower_bound(long[] a, long v) {
        int low = -1, high = a.length;
        while (high - low > 1) {
            int h = high + low >>> 1;
            if (a[h] >= v) {
                high = h;
            } else {
                low = h;
            }
        }
        return high;
    }

    private int gcd(int a, int b) {
        while (b > 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    private int lcm(int a, int b) {
        return a * (b / gcd(a, b));
    }

    private int[] na(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    private long[] nal(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return parseLong(next());
    }

    double nextDouble() throws IOException {
        return parseDouble(next());
    }

    String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    public static void main(String[] args) throws Exception {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(new OutputStreamWriter(System.out));
            //long lStartTime = System.currentTimeMillis();
            new A().solve();
            //long lEndTime = System.currentTimeMillis();
            //out.println("Elapsed time in seconds: " + (double)(lEndTime - lStartTime) / 1000.0);
            in.close();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            exit(1);
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
    solver.solve(1, in, out);
    out.close();
  }

  static class BPetrAndACombinationLock {

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      int[] arr = in.nextIntArray(n);
      for (int i = 0; i < (1 << n); ++i) {
        int sum = 0;
        for (int j = 0; j < n; ++j) {
          if ((i & (1 << j)) > 0) {
            sum += arr[j];
          } else {
            sum -= arr[j];
          }
        }
        if (sum == 0 || sum % 360 == 0) {
          out.println("YES");
          return;
        }
      }
      out.println("NO");
    }

  }

  static class InputReader {

    private InputStream stream;
    private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
    private static final int EOF = -1;
    private byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (this.numChars == EOF) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

          try {
            this.numChars = this.stream.read(this.buf);
          } catch (IOException ex) {
            throw new InputMismatchException();
          }

          if (this.numChars <= 0) {
            return EOF;
          }
        }

        return this.buf[this.curChar++];
      }
    }

    public int nextInt() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      int res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }

      throw new InputMismatchException();
    }

    public static boolean isSpaceChar(int c) {
      return c == 32 || c == 10 || c == 13 || c == 9 || c == EOF;
    }

    public int[] nextIntArray(int n) {
      int[] arr = new int[n];
      for (int i = 0; i < n; i++) {
        arr[i] = nextInt();
      }
      return arr;
    }

  }
}

import java.util.*;
public class A {
	static int[] a;
	static int n;
	static int[][] DP;
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		a= new int[n];
		DP = new int[n][720];
		for(int i = 0;i<n;i++){
			a[i] = sc.nextInt();
			for(int j = 0;j<360;j++){
				DP[i][j] = -1;
				DP[i][j+360] = -1;
			}
		}
		if(r(0, 0)>0){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
	public static int r(int i, int s){
		s%=360;
		if(i==n && s==0){
			return 1;
		}
		if(i>=n){
			return 0;
		}
		if(DP[i][s+360]>-1){
			return DP[i][s+360];
		}
		else{
			return DP[i][s+360] = r(i+1, s+a[i]) + r(i+1, s-a[i]);
		}
	}
}

import java.util.Scanner;
public class Solution {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) a[i] = sc.nextInt();
		for (int i = 1; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) sum += a[j];
				else sum -= a[j];
			}
			if ( sum == 0 || sum % 360 == 0 ) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class BPetrAndACombinationLock {
    static class Solution {
        int[]mat = {1, -1};
        //Boolean[][]dp;
        Map<String, Boolean> map;
        public void find(int[] arr) {
            map = new HashMap();
            boolean res = possible(arr, 0, 0);
            System.out.println(res==true? "YES" : "NO");
        }

        boolean possible(int[] arr, int index, int sum) {
            if(index == arr.length) {
                if(sum%360 == 0) {
                    return true;
                }
                return false;
            }

            String key = index + "/" + sum;

            if(map.containsKey(key)) return map.get(key);
            for(int i=0; i<2; i++) {
                if(possible(arr, index+1, sum+(arr[index]*mat[i]))) {
                    map.put(key, true);
                    return true;
                }
            }
            map.put(key, false);
            return false;
        }
    }

    public static void main(String[] args) {
        Solution sol = new Solution();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }
        sol.find(arr);
    }
}

import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class PA {

    public static boolean backtrack(int arr[] , int sum , int i)
    {
        if(i == arr.length) {

            return (sum % 360 == 0);

        }

        return backtrack(arr , sum + arr[i] , i+1) || backtrack(arr , sum - arr[i] , i+1);

    }

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

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

        int n = Integer.parseInt(br.readLine());
        int arr[] = new int [n];

        for(int i = 0 ; i < n ; i++)
        {
            arr[i] = Integer.parseInt(br.readLine());
        }

        if(backtrack(arr , 0 , 0))
            out.println("YES");
        else
            out.println("NO");

        out.flush();
        out.close();

    }

}

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

public class CF1097_Petr_And_combination_Lock implements Closeable {
    static String filePath = "/home/bishoy/IdeaProjects/Arabic competetive programming/src/b/test";
    BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

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

        CF1097_Petr_And_combination_Lock c = new CF1097_Petr_And_combination_Lock();
        c.solve2();
        c.close();
    }

    public void solve2() throws IOException {
        int n = nextInt();
        arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        if (ffff(0, 0))
            writer.println("yes");
        else
            writer.println("no");

    }

    int arr[];

    //left [0], right sum [1];
    int mem[][] = new int[2][360];
    boolean possible = false;

    boolean ffff(int sum, int i) {

        if (i == arr.length) {
            if (sum == 0 || sum % 360 == 0)
                return true;
            else
                return false;
        }

        boolean s1 = ffff(arr[i] + sum, i + 1);
        boolean s2 = ffff(-arr[i] + sum, i + 1);
        if (s1 || s2)
            return true;

        return false;
    }

    int findSum(int sum, int i) {

        if (i == arr.length) {
            return sum;
        }

        return 0;
    }

    StringTokenizer stringTokenizer;

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            stringTokenizer = new StringTokenizer(inputReader.readLine());
        }
        return stringTokenizer.nextToken();
    }

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

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

    int[] nextIntArr(int n) throws IOException {
        int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    long[] nextLongArr(int n) throws IOException {
        long arr[] = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextLong();
        }
        return arr;
    }

    @Override
    public void close() throws IOException {
        inputReader.close();
        writer.close();
    }

    static class Helper {
        BufferedReader inputReader = null;
        PrintWriter out = null;
        public static final int FILE = 0;
        public static final int STD = 1;

        public static class Pair<K, V> {
            public K key;
            public V value;

            public Pair(K key, V value) {
                this.key = key;
                this.value = value;
            }

            @Override
            public String toString() {
                return "( " + key + " , " + value + ")";
            }
        }

        public BufferedReader readInput(int type, String filePath) {
            if (type == FILE) {
                try {
                    inputReader = new BufferedReader(
                            new InputStreamReader(new FileInputStream(filePath)));
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                }
            } else
                inputReader = new BufferedReader(new InputStreamReader(System.in));

            return inputReader;
        }

    }
}

/**
 * @author : Kshitij
 */
import java.io.*;
import java.util.InputMismatchException;

public class Main2 {
    public static void main(String[] xps){
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        StringBuilder stringBuilder = new StringBuilder();

        int t=1;
        while (t-->0){
            int n=in.Int();
            int[] a = new int[n];
            for(int i = 0; i < n ; i++){
                a[i]=in.Int();
            }
            boolean done=false;
            for(int mask = 0; mask < (1 << n); mask++) {
                int sum_of_this_subset = 0;
                for(int i = 0; i < n; i++) {
                    if((mask & (1 << i)) >0) {
                        sum_of_this_subset += a[i];
                    }
                    else{
                        sum_of_this_subset -=a[i];
                    }
                }
//                out.print(sum_of_this_subset+" ");
                if(sum_of_this_subset % 360== 0 || sum_of_this_subset==0) {
                    stringBuilder.append("YES").append("\n");
                    done=true;
                    break;
                }
            }
            if (!done)
                stringBuilder.append("NO").append("\n");
        }
        out.println(stringBuilder);
    }

    private static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int Int() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String String() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public double Double() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, Int());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E') {
                        return res * Math.pow(10, Int());
                    }
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public long Long() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    private static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
            writer.flush();
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
            writer.flush();
        }

        public void close() {
            writer.close();
        }

        public void flush() {
            writer.flush();
        }
    }
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class BPetrAndACombinationLock {
    static class Solution {
        int[]mat = {1, -1};
        //Boolean[][]dp;
        //Map<String, Boolean> map;
        public void find(int[] arr) {
            //map = new HashMap();
            boolean res = possible(arr, 0, 0);
            System.out.println(res==true? "YES" : "NO");
        }

        boolean possible(int[] arr, int index, int sum) {
            if(index == arr.length) {
                if(sum%360 == 0) {
                    return true;
                }
                return false;
            }

            //String key = index + "/" + sum;

            //if(map.containsKey(key)) return map.get(key);
            for(int i=0; i<2; i++) {
                if(possible(arr, index+1, sum+(arr[index]*mat[i]))) {
                    //map.put(key, true);
                    return true;
                }
            }
            //map.put(key, false);
            return false;
        }
    }

    public static void main(String[] args) {
        Solution sol = new Solution();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }
        sol.find(arr);
    }
}

import java.util.*;
public class Combination
{
	static int flag=0;
	static void rotate(int rot[],int n,int sum)
	{
		if(n<-1)
		{
			return;
		}
		if(n==0&&(sum==0||sum%360==0))
		{
			flag=1;
			return;
		}
		if(n>0)
		{
			rotate(rot,n-1,sum+rot[n-1]);
			rotate(rot,n-1,sum-rot[n-1]);
		}

	}
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int rot[]=new int[n];
		for(int i=0;i<n;i++)
		{
			rot[i]=sc.nextInt();
		}
		rotate(rot,n,0);
		if(flag==1)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
}

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

public class Main {

	public static void solve(InputReader in ) {
		int n = in.readInt();
		int a[] = new int[n];
		for(int i = 0; i<n; i++)
			a[i] = in.readInt();

		for(int i = 0; i<(1<<n); i++) {
			int x = 0;
			for(int j = 0; j<n; j++) {
				if((i & (1 << j)) == 0)
					x += a[j];
				else
					x -= a[j];
			}
			if(x % 360 == 0) {
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		int t = 1;
		while (t-- > 0)
			solve(in);
	}
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	 public InputReader(InputStream stream) {
		this.stream = stream;
	}

     public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

     public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

     public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

     public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

     public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

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

     public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

import java.io.*;
import java.util.*;
public class Combilock
{
	public static void main(String args[])throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int arr[] = new int[n];
		for(int i=0;i<n;i++)
		{
			arr[i]= Integer.parseInt(br.readLine());
		}
		for(int j=0;j<1<<n;j++)
		{
			int sum=0;
		for(int i=0;i<n;i++)
		{
			if((j&(1<<i))==0){
		//		System.out.print("+" + arr[i]);
				sum+=arr[i];
			}
			else{
		//		System.out.print("-" + arr[i]);
				sum-=arr[i];
			}
		}
		// System.out.println(" = "+ sum);
		if(sum%360==0){
			System.out.println("YES");
			return;
		}
		}
		System.out.println("NO");
	}
}

import java.util.Scanner;

public class CombinationLock {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in) ;

		int n = sc.nextInt() ;

		int arr[] = new int[n] ;

		for(int i = 0; i < n ; i++)
		{
			arr[i] = sc.nextInt() ;
		}

//		System.out.println(isPossible(arr, 0, 0));
		if(isPossible(arr, 0, 0))
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}

	}

	public static boolean isPossible(int arr[],int vidx , int sum)
	{

		if((sum == 0||sum %360==0) && vidx != 0&& vidx == arr.length)
		{
			return true;
		}
		if(vidx == arr.length)
		{
			return false ;
		}

		boolean recRes = isPossible(arr, vidx + 1, sum + arr[vidx]) ;
		if(recRes)
		{
			return true;
		}

		recRes = isPossible(arr, vidx + 1, sum - arr[vidx]) ;

		if(recRes)
		{
			return true;
		}
		return recRes ;

	}

}

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

public class Main {
    public static boolean possible(int [] degrees,int total,int n){
        if (total%360==0){
            total=0;
        }
        if(n<0){
            if (total==0){
                return true;
            }
            return false;
        }
        else return possible(degrees,total+degrees[n],n-1) ||
                possible(degrees,total-degrees[n],n-1);
    }

    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int [] degrees = new int[n];
        for (int i=0;i<n;i++){
            degrees[i]=scanner.nextInt();
        }
        if(possible(degrees,0,n-1)){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }

    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inclass in = new inclass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrAndACombinationLock {
        int n = 0;

        public void solve(int testNumber, inclass in, PrintWriter out) {
            n = in.nextInt();
            int arr[] = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            if (rec(0, new int[n], 0, arr)) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean rec(int idx, int[] arr, int count, int[] real) {
            if (count == n) {
                if (ok(arr, real)) {
                    return true;
                }
                return false;
            }
            arr[idx] = 1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            arr[idx] = -1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            return false;
        }

        private boolean ok(int[] ones, int[] arr) {
            int sum = 0;
            for (int i = 0; i < ones.length; i++) {
                sum += ones[i] * arr[i];
            }
            return sum % 360 == 0;
        }

    }

    static class inclass {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private inclass.SpaceCharFilter filter;

        public inclass(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class a {
	static 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]; // line length
			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();
		}
	}

	// User Defined Method start
	public static int inputInt() throws IOException {
		return sc.nextInt();
	}

	public static long inputLong() throws IOException {
		return sc.nextLong();
	}

	public static double inputDouble() throws IOException {
		return sc.nextDouble();
	}

	public static String inputString() throws IOException {
		return sc.readLine();
	}

	public static void print(String a) throws IOException {
		bw.write(a);
	}

	public static void printSp(String a) throws IOException {
		bw.write(a + " ");
	}

	public static void println(String a) throws IOException {
		bw.write(a + "\n");
	}
	// User Defined Method End

	// Helper Function - start
	private static void printArray(Integer arr[]) {
		for (int i : arr)
			System.out.print(i + " ");
		System.out.println();
	}

	private static void inputArray(int arr[]) throws IOException {
		for (int i = 0; i < arr.length; i++) {
			arr[i] = s1.nextInt();
		}
	}

	// helper Function - End

	// Defining input and output stream obj - Start
	static Reader sc = new Reader();
	static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static Scanner s1 = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		int n = s1.nextInt();
		int arr[] = new int[n];

		inputArray(arr);

//		for (int i = 0; i < arr.length; i++) {
//			System.out.println(arr[i]);
//		}

		for(int i=0;i<Math.pow(2, n);i++)
		{
			int sum = 0;
			for(int j=0;j<n;j++)
			{
				if((i & (1<<j)) != 0){
					sum = (sum + arr[j])%360;
				}
				else
					sum = (sum - arr[j])%360;
			}
// 			System.out.println(sum);
			if(sum == 0){
				System.out.println("YES");
				return;
			}

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

}

import java.util.*;
public class ProblemB {
    public static void main(String[] argc)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];

        for(int i = 0; i < n; i++)
        {
            a[i] = sc.nextInt();
        }
        boolean res = false;
        for(int i = 0; i < (Math.pow(2, n) - 1); i++)
        {
            int angles_Sum = 0;
            String candidate = Integer.toBinaryString(i);
            //System.out.println(candidate);

            int len = candidate.length();
            int cur_Idx = 0;
            for(int j = len - 1; j >= 0; j--)
            {
                char tmp = candidate.charAt(j);
                if(tmp == '0') //Cw
                    angles_Sum += a[cur_Idx];
                else
                    angles_Sum -= a[cur_Idx];

                cur_Idx++;
            }
            if(len < n)
            {
                int loop_times = n -len;
                for(int idx = 0; idx < loop_times; idx++)
                {
                    angles_Sum += a[cur_Idx];
                    cur_Idx++;
                }
            }

            //System.out.println(angles_Sum);

            if (angles_Sum % 360 == 0)
            {
                res = true;
                break;
            }
        }
        if(res == true)
        {
            System.out.println("YES");
        }
        else
        {
            System.out.println("NO");
        }
    }
}

import java.util.Scanner;

public class Main {

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

    for (int i = 0; i < n; ++i)
      a[i] = sc.nextInt();

    if (check(n - 1, a))
      System.out.println("YES");
    else
      System.out.println("NO");
  }

  public static boolean check(int i, int[] a) {
    if (i == 0) {
      int res1 = 0;
      for (int ang : a)
        res1 += ang;
      int res2 = res1 - 2 * a[0];
      return (res1 % 360 == 0) || (res2 % 360 == 0);
    }

    int[] a1 = a.clone();
    a1[i] = -a1[i];

    return check(i - 1, a) || check(i - 1, a1);
  }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.lang.StrictMath.*;

/**
 *
 * @author Hatim
 */
public class Main {

	public static void main(String[] args) {
		new Solver().solve();
	}

}

class Solver {

	public void solve() {
		PrintWriter out = new PrintWriter(System.out, true);
		FastReader cd = new FastReader();
		int[] rotations = new int[cd.nextInt()];
		for (int i = 0; i < rotations.length; i++) {
			rotations[i] = cd.nextInt();
		}
		for (int i = 0; i < (1 << rotations.length); i++) {
			int sum = 0;
			for (int j = 0; j < rotations.length; j++) {
				if ((i & (1 << j)) != 0) {
					sum += rotations[j];
				} else {
					sum -= rotations[j];
				}
			}
			if (sum % 360 == 0) {
				out.println("YES");
				return;
			}
		}
		out.println("NO");
		cd.close();
		out.close();
	}

	class FastReader {
		private BufferedReader in;
		private StringTokenizer tokenizer;

		public FastReader() {
			in = new BufferedReader(new InputStreamReader(System.in), 233333);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(in.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

		public void close() {
			try {
				in.close();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
	}
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

import java.util.*;

public class Test {

    static int a[], n;

    static boolean solve(int i, int s){
        if(i==n && s!=0) return false;
        if(i==n && s==0) return true;
        return solve(i + 1, Math.abs(s + a[i]) % 360)||solve(i + 1, Math.abs(s - a[i]) % 360);
    }

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        a = new int[n];
        for(int i = 0; i<n; i++) a[i] = in.nextInt();
        System.out.println(solve(0, 0)?"YES":"NO");
    }

}

import java.util.*;
public class ProblemB {
    public static void main(String[] argc)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];

        for(int i = 0; i < n; i++)
        {
            a[i] = sc.nextInt();
        }
        boolean res = false;
        for(int mask = 0; mask < (1 << n); mask++)
        {
            int angles_Sum = 0;
            String candidate = Integer.toBinaryString(mask);
            //System.out.println(candidate);

            int len = candidate.length();
            int cur_Idx = 0;
            for(int j = len - 1; j >= 0; j--)
            {
                char tmp = candidate.charAt(j);
                if(tmp == '0') //Cw
                    angles_Sum += a[cur_Idx];
                else
                    angles_Sum -= a[cur_Idx];

                cur_Idx++;
            }
            if(len < n)
            {
                int loop_times = n -len;
                for(int idx = 0; idx < loop_times; idx++)
                {
                    angles_Sum += a[cur_Idx];
                    cur_Idx++;
                }
            }

            //System.out.println(angles_Sum);

            if (angles_Sum % 360 == 0)
            {
                res = true;
                break;
            }
        }
        if(res == true)
        {
            System.out.println("YES");
        }
        else
        {
            System.out.println("NO");
        }
    }
}

import java.util.Scanner;

public class CF_1097B {
    public static boolean combinationLock(int[] rotations, int start, int end, int currSum) {
        if (start >= end) {
            return (currSum % 360 == 0);
        }
        return combinationLock(rotations, start + 1, end, currSum + rotations[start])
                || combinationLock(rotations, start + 1, end, currSum - rotations[start]);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] rotations = new int[n];
        for (int i = 0; i < n; i++)
            rotations[i] = scanner.nextInt();
        if (combinationLock(rotations, 0, n, 0)) {
            System.out.print("YES");
        } else {
            System.out.print("NO");
        }
        scanner.close();
    }
}

import java.util.Scanner;

public class Solution {

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

        for (int i = 0; i < N; i++) {
            w[i] = in.nextInt();
        }

        for (int i = 0; i < (1 << N); i++) {
            int sum = 0;
            for (int j = 0; j < N; j++) {
                if ((i & (1 << j)) == 0) {
                    sum += w[j];
                } else {
                    sum -= w[j];
                }
            }

            if (sum % 360 == 0) {
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}

import java.awt.image.AreaAveragingScaleFilter;
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class Newbie {

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solver s = new solver();
        int t = 1;
        while (t > 0) {
            s.solve();
            t--;
        }
        out.close();
    }

    static class InputReader {

        public BufferedReader br;
        public StringTokenizer token;

        public InputReader(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream), 32768);
            token = null;
        }

        public String sn() {
            while (token == null || !token.hasMoreTokens()) {
                try {
                    token = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return token.nextToken();
        }

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

        public String snl() throws IOException {
            return br.readLine();
        }

        public long nlo() {
            return Long.parseLong(sn());
        }

        public double nd() {
            return Double.parseDouble(sn());
        }

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

        public long[] nal(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.nlo();
            return a;
        }
    }

    static int inf = 5000013;

    static class solver {
        DecimalFormat df = new DecimalFormat("0.00000000");
        int maxi = 200000000;
        long mod = (long) (1e9 + 9);

        void solve() {
            int n = sc.ni();
            int mask = (1 << n);
            int a[] = sc.na(n);
            int total = 0;
            for (int i = 0; i < n; i++)
                total += a[i];
            boolean ans = false;
            if (total == 360)
                ans = true;
            for (int i = 0; i < mask; i++) {
                int sum = 0;
                for (int j = 0; j < n; j++) {
                    if ((i & (1 << j)) != 0) {
                        sum += a[j];
                    }
                }
                int d = total - sum;
                int abs = Math.abs(d - sum);
                if (abs == 0 || abs%360==0) {
                    ans = true;
                    break;
                }
            }
            out.println((ans) ? "YES" : "NO");
        }
    }
}

import java.util.Scanner;

public class S {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = sc.nextInt();
        }

        for (int i = 0; i < 32768; i++) {
            int angle = 0;
            for (int j = 0; j < n; j++) {
                if (((i >> j) & 1) == 0) {
                    angle -= arr[j];
                } else {
                    angle += arr[j];
                }
            }
            if (angle % 360 == 0) {
                System.out.println("YES");
                return;
            }
        }

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.lang.StrictMath.*;

/**
 *
 * @author Hatim
 */
public class Main {

	public static void main(String[] args) {
		new Solver().solve();
	}

}

class Solver {

	public void solve() {
		PrintWriter out = new PrintWriter(System.out, true);
		FastReader cd = new FastReader();
		int[] rotations = new int[cd.nextInt()];
		for (int i = 0; i < rotations.length; i++) {
			rotations[i] = cd.nextInt();
		}
		out.println(dfs(rotations, 0, 0) ? "YES" : "NO");
		cd.close();
		out.close();
	}

	boolean dfs(int[] a, int sum, int cnt) {
		if (cnt == a.length) {
			return sum % 360 == 0;
		}
		return dfs(a, sum + a[cnt], cnt + 1) || dfs(a, sum - a[cnt], cnt + 1);
	}

	class FastReader {
		private BufferedReader in;
		private StringTokenizer tokenizer;

		public FastReader() {
			in = new BufferedReader(new InputStreamReader(System.in), 233333);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(in.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

		public void close() {
			try {
				in.close();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
	}
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(in.readLine());

		Queue<Integer> degrees = new LinkedList<>();
		while (n-- > 0) degrees.offer(Integer.parseInt(in.readLine()));

		System.out.println(evaluateCases(degrees, -degrees.remove()) ? "YES" : "NO");
	}

	private static boolean evaluateCases(Queue<Integer> degrees, int num) {
		if (Math.abs(num) % 360 == 0 && degrees.isEmpty())
			return true;
		if (degrees.isEmpty())
			return false;

		int peek = degrees.remove();
		Queue<Integer> degreesTmp1 = new LinkedList<>(degrees), degreesTmp2 = new LinkedList<>(degrees);
		return evaluateCases(degreesTmp1, num + peek) || evaluateCases(degreesTmp2, num - peek);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.LinkedList;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Emmanuell
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrAndACombinationLock {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int sum = 0;

            ArrayList<Integer> possibities = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                int a = in.nextInt();
                if (possibities.isEmpty()) {
                    possibities.add(a);
                } else {
                    LinkedList<Integer> list = new LinkedList<>();
                    for (int j = 0; j < possibities.size(); j++) {
                        Integer x = possibities.get(j);
                        list.add((x - a) % 360);
                        list.add((x + a) % 360);
                    }
//                out.println(list);
                    possibities.clear();
                    possibities.addAll(list);
                }
            }
            if (possibities.contains(0) || possibities.contains(360)) {
                out.println("YES");
            } else {
                out.println("NO");
            }

        }

    }
}

import java.io.*;
public class b1109
{static int a[],n;
	public static int fun(int a[],int i,int s)
	{
	if(i==n)
	{
	if(s%360==0) return 1;
	else
	return 0;}
	int x =fun(a,i+1,s+a[i]);
	if(x==1)
		return 1;
	int y= fun(a,i+1,s-a[i]);
	if(y==1)
		return 1;
	else
		return 0;
	}
	public static void main(String args[])throws IOException
	{b1109 ob=new b1109();
	BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
    n=Integer.parseInt(input.readLine());
    a=new int[n];int s=0,i;
    for( i=0;i<n;i++)
    {
   a[i]=Integer.parseInt(input.readLine());
   s+=a[i];
    }
    if(s==0||s==360)
    System.out.println("YES");
    else
    {i=ob.fun(a,0,0);
    if(i==0)
    System.out.println("NO");
    else
    System.out.println("YES");
	}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Queue;

public class Problem1097B {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(in.readLine());

		Queue<Integer> degrees = new LinkedList<>();
		while (n-- > 0) degrees.offer(Integer.parseInt(in.readLine()));

		System.out.println(evaluateCases(degrees, -degrees.remove()) ? "YES" : "NO");
	}

	private static boolean evaluateCases(Queue<Integer> degrees, int num) {
		if (degrees.isEmpty()) {
			if (Math.abs(num) % 360 == 0) return true;
			return false;
		}

		int peek = degrees.remove();
		Queue<Integer> degreesTmp1 = new LinkedList<>(degrees), degreesTmp2 = new LinkedList<>(degrees);
		return evaluateCases(degreesTmp1, num + peek) || evaluateCases(degreesTmp2, num - peek);
	}
}

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] a = new int[n];

        for(int i=0; i<n; i++) {
            a[i] = sc.nextInt();
        }

        int x;
        boolean yes = false;

        for(int i=0; i<Math.pow(2, n); i++) {

            String s = String.format("%015d", Long.parseLong(Integer.toBinaryString(i)));
            x = 0;

            for(int j=15-n, k=0; j<15; j++, k++) {

                if(s.charAt(j)=='0') {
                    x -= a[k];
                }
                else {
                    x += a[k];
                }
            }
            if(x == 0 || x == 360 || x==720 || x==1080 || x==1440 || x==1800 || x==2160 || x==2520 || x==2880) {
                yes = true;
                break;
            }
        }
        if(yes) {
            System.out.println("YES");
        }
        else {
            System.out.println("NO");
        }
    }

}

import java.io.*;
import java.util.*;
public class Try {
static int n;
static boolean o=false;
static int[]a;
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		PrintWriter out =new PrintWriter (System.out);
		n=sc.nextInt();
		a=new int [n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
	    T(0,0);
	    if(o)
	    	out.println("YES");
	    else
	    	out.println("NO");
        out.flush();
	}
	static void T(int i,int s) {
		if(i==n) {
		   if(s%360==0)
			o=true;
		//	System.out.println(s);
			return;
		}
		 T(i+1,s+(-1*a[i]));
		 T(i+1,s+a[i]);
	}
	static	class Scanner{
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}

import java.util.Scanner;
public class Solution {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) a[i] = sc.nextInt();
		for (int i = 1; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) > 0) sum += a[j];
				else sum -= a[j];
			}
			if ( sum == 0 || sum % 360 == 0 ) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}
}

import java.util.Scanner;

public class Rotation {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a = new int[n];
        for(int i=0; i<n; i++)
            a[i] = s.nextInt();
        int sum = 0;
        int test = 1 << (n-1);
        for(int i=0; i<test; i++) {
            int b = i;
            sum = 0;
            for (int j = 0; j < n; j++) {
                if ((b & 1) == 1)
                    sum += a[j];
                else
                    sum -= a[j];
                b >>= 1;
            }
            if(sum%360==0) {
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");

    }
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class BPetrAndACombinationLock {
    static class Solution {
        int[]mat = {1, -1};
        //Boolean[][]dp;
        //Map<String, Boolean> map;
        public void find(int[] arr) {
            //map = new HashMap();
            boolean res = possible(arr, 0, 0);
            System.out.println(res==true? "YES" : "NO");
        }

        boolean possible(int[] arr, int index, int sum) {
            if(index == arr.length) {
                if(sum%360 == 0) {
                    return true;
                }
                return false;
            }

            //String key = index + "/" + sum;

            //if(map.containsKey(key)) return map.get(key);
            for(int i=0; i<2; i++) {
                if(possible(arr, index+1, sum+(arr[index]*mat[i]))) {
                    //map.put(key, true);
                    return true;
                }
            }
            //map.put(key, false);
            return false;
        }
    }

    public static void main(String[] args) {
        Solution sol = new Solution();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0; i<n; i++) {
            arr[i] = sc.nextInt();
        }
        sol.find(arr);
    }
}

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

/* abhi2601 */

public class Q1 implements Runnable{

    final static long mod = (long)1e9 + 7;
    public void run() {

        InputReader sc = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n=sc.nextInt(),sum=0;
        int a[]=new int[n];
        ArrayList<Integer>al=new ArrayList<>();
        for(int i=0;i<n;i++){
            a[i]=sc.nextInt();
            sum+=a[i];
        }
        al.add(sum);
        for(int i=0;i<n;i++){
            int l=al.size();
            for(int j=0;j<l;j++){
                al.add(al.get(j)-2*a[i]);
            }
        }
        for(int i=0;i<al.size();i++){
            if(al.get(i)%360==0){
                w.println("YES");
                w.close();
                break;
            }
        }
        w.println("NO");
        w.close();
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                }
                catch (IOException e)
                {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine()
        {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt()
        {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do
            {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.')
            {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.')
            {
                c = read();
                double m = 1;
                while (!isSpaceChar(c))
                {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

    public static void main(String args[]) throws Exception
    {
        new Thread(null, new Q1(),"q1",1<<26).start();
    }
}

import java.util.Scanner;

public class CF_PetrolSum {

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

		for(int i=0;i<num;i++)
			rotations[i]=s.nextInt();

		System.out.println(GenerateSubsets(rotations,0,0)? "YES": "NO");
	}

	private static boolean GenerateSubsets(int[] a, int index, int sum)
	{

		if(index==a.length)
		{
			if(Math.abs(sum)%360==0)
			return true;
		return false;
		}

		return GenerateSubsets(a,index+1,sum+a[index])||
		GenerateSubsets(a,index+1,sum-a[index]);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.TreeSet;

public class practice_DP {

	static Reader r = new Reader();
	static PrintWriter out = new PrintWriter(System.out);

	private static void solve1() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();
			int m = r.nextInt();

			int x = r.nextInt();
			int y = r.nextInt();

			char ch[][] = new char[n][m];

			long ans = 0;

			for (int i = 0; i < n; i++) {
				ch[i] = r.next().toCharArray();
				for (int j = 0; j < m; j++) {
					if (ch[i][j] == '.') {
						if (j + 1 < m && ch[i][j + 1] == '.') {
							if (2 * x < y) {
								ans += 2 * x;
							} else {
								ans += y;
							}
							j++;
						} else {
							ans += x;
						}
					}
				}
			}

			res.append(ans).append("\n");

		}

		out.print(res);
		out.close();
	}

	private static void solve2() throws IOException {

		StringBuilder res = new StringBuilder();

		int n = r.nextInt();
		int k = r.nextInt();

		int arr[] = r.nextIntArray(n);

		int cnt = 0;

		for (int i = 1; i < n; i++) {
			if (arr[i] + arr[i - 1] < k) {
				cnt += k - (arr[i] + arr[i - 1]);
				arr[i] += k - (arr[i] + arr[i - 1]);
			}
		}

		res.append(cnt).append("\n");
		for (int i = 0; i < n; i++) {
			res.append(arr[i] + " ");
		}

		out.print(res);
		out.close();

	}

	private static void solve3() throws IOException {

		int n = r.nextInt();

		int ans = 0;
		if ((n & 1) != 0) {
			ans = 0;
		} else {
			ans = (int) Math.pow(2, n / 2);
		}

		out.print(ans);
		out.close();

	}

	private static void solve4() throws IOException {

		int n = r.nextInt();

		int cnt = 0;

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

		int start = 1, sum = 0;
		while (true) {
			sum += start;
			if (sum > n) {
				sum -= start;
				break;
			} else {
				ans.add(start++);
			}
		}

//		System.out.println(sum);
//		System.out.println(ans);

		ans.set(ans.size() - 1, ans.get(ans.size() - 1) + (n - sum));
		out.print(ans.size() + "\n");
		for (int candies : ans) {
			out.print(candies + " ");
		}
		out.close();

	}

	private static void solve5() throws IOException {

		int n = r.nextInt();

		int fibo[] = new int[21];
		fibo[0] = fibo[1] = 1;

		for (int i = 2; i <= 20; i++) {
			fibo[i] = (fibo[i - 1] + fibo[i - 2]);
		}

		out.print(fibo[n]);
		out.close();

	}

	private static int binarySearch6(int ele) {
		int lt = 0, rt = arr.length - 1;
		int ans = 0;
		while (lt <= rt) {
			int mid = (lt + rt) / 2;
			if (arr[mid] > ele) {
				rt = mid - 1;
			} else {
				ans = mid + 1;
				lt = mid + 1;
			}
		}
		return ans;
	}

	private static void solve6() throws IOException {

		StringBuilder res = new StringBuilder();

		int n = r.nextInt();
		arr = r.nextIntArray(n);

		Arrays.sort(arr);

		int q = r.nextInt();
		while (q-- > 0) {
			int ele = r.nextInt();
			res.append(binarySearch6(ele)).append("\n");
		}

		out.print(res);
		out.close();

	}

	private static void solve7() throws IOException {

		String s = r.next();

		int dp1[] = new int[s.length() + 1];
		int dp2[] = new int[s.length() + 1];

		dp1[0] = dp2[0] = 0;
		for (int i = 0; i < s.length(); i++) {
			dp1[i + 1] = dp1[i];
			dp2[i + 1] = dp2[i];
			if (s.charAt(i) == '.') {
				if (i + 1 < s.length() && s.charAt(i + 1) == '.') {
					dp1[i + 1]++;
				}
			} else {
				if (i + 1 < s.length() && s.charAt(i + 1) == '#') {
					dp2[i + 1]++;
				}
			}
		}

//		System.out.println(Arrays.toString(dp1));
//		System.out.println(Arrays.toString(dp2));

		int m = r.nextInt();
		while (m-- > 0) {

			int lt = r.nextInt() - 1;
			int rt = r.nextInt() - 1;

			out.print(dp1[rt] - dp1[lt] + dp2[rt] - dp2[lt] + "\n");

		}
		out.close();

	}

	static class Query {
		int pos, val;

		public Query(int idx, int vali) {
			pos = idx;
			val = vali;
		}
	}

	static int cnt = 0, freq[], arr[];

	private static void add(int idx) {
		if (freq[arr[idx]] == 0) {
			cnt++;
		}
		freq[arr[idx]]++;
	}

	private static void remove(int idx) {
		freq[arr[idx]]--;
		if (freq[arr[idx]] == 0) {
			cnt--;
		}
	}

	private static void solve8() throws IOException {

		int n = r.nextInt();
		int m = r.nextInt();

		arr = new int[n + 1];
		freq = new int[(int) 1e5 + 1];
		Query q[] = new Query[m];

		for (int i = 1; i <= n; i++) {
			arr[i] = r.nextInt();
			add(i);
		}

		// Applying MO's Algorithm

		for (int i = 0; i < m; i++) {
			q[i] = new Query(i, r.nextInt());
		}
		Arrays.sort(q, new Comparator<Query>() {
			@Override
			public int compare(Query o1, Query o2) {
				return o1.val - o2.val;
			}
		});

		int ans[] = new int[m];
		int lt = 1;
		for (int i = 0; i < m; i++) {
			int val = q[i].val;
			while (lt < val) {
				remove(lt++);
			}
			ans[q[i].pos] = cnt;
		}

		for (int i = 0; i < m; i++) {
			out.println(ans[i]);
		}
		out.close();

	}

	private static void solve9() throws IOException {

		int n = r.nextInt();
		int k = r.nextInt();

		int dp[] = r.nextIntArray(n);
		for (int i = 1; i < n; i++) {
			dp[i] += dp[i - 1];
		}

		int min = dp[k - 1], ans = 0;

		for (int i = k; i < n; i++) {
			if (dp[i] - dp[i - k] < min) {
				min = dp[i] - dp[i - k];
				ans = i - k + 1;
			}
		}

		out.print(++ans);
		out.close();

	}

	private static long sum(long n) {
		return ((n * (3 * n + 1)) / 2);
	}

	private static long binarySearch10(long n) {
		long lt = 1, rt = n;
		long ans = 0;
		while (lt <= rt) {
			long mid = (lt + rt) / 2;
			long val = sum(mid);
			if (val <= n) {
				ans = mid;
				lt = mid + 1;
			} else {
				rt = mid - 1;
			}
		}
		return ans;
	}

	private static void solve10() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			long n = r.nextLong();

			long cnt = 0;

			while (n > 1) {
				long tallest = binarySearch10(n);
				cnt++;
				n -= sum(tallest);
			}

			out.println(cnt);

		}
		out.close();

	}

	private static void solve11() throws IOException {

		int a1 = r.nextInt();
		int a2 = r.nextInt();

		int temp = a1;
		a1 = Math.min(a1, a2);
		a2 = Math.max(a2, temp);

		int cnt = 0;
		while (a1 > 0 && a2 > 0) {
			if (a1 <= 1 && a2 <= 1) {
				break;
			}
			if (a1 > 2) {
				cnt++;
				a1 -= 2;
				a2++;
			} else {
				cnt++;
				a1++;
				a2 -= 2;
			}
		}

		out.print(cnt);
		out.close();

	}

	private static int digitSum(int num) {
		int sum = 0;
		while (num > 0) {
			sum += (num % 10);
			num /= 10;
		}
		return sum;
	}

	private static void solve12() throws IOException {

		int k = r.nextInt();

		int num = 18;
		while (k > 0) {
			if (digitSum(++num) == 10) {
				k--;
			}
		}

		out.print(num);
		out.close();

	}

	private static void solve13() throws IOException {

		int n = r.nextInt();

		int h[] = new int[n];
		int w[] = new int[n];
		int hi[] = new int[n];
		int w_cumu = 0;

		for (int i = 0; i < n; i++) {
			w[i] = r.nextInt();
			w_cumu += w[i];
			h[i] = r.nextInt();
			hi[i] = h[i];
		}

		Arrays.sort(hi);

		for (int i = 0; i < n; i++) {
			int ans = (w_cumu - w[i]);
			if (hi[n - 1] == h[i]) {
				ans *= hi[n - 2];
			} else {
				ans *= hi[n - 1];
			}
			out.print(ans + " ");
		}
		out.close();

	}

	private static long maxDigit(long num) {
		long max = -1;
		while (num > 0) {
			long digit = num % 10;
			num /= 10;
			max = Math.max(max, digit);
		}
		return max;
	}

	private static void solve14() throws IOException {

		long n = r.nextLong();

		long cnt = 0;
		while (n > 0) {
			n -= maxDigit(n);
			cnt++;
		}

		out.print(cnt);
		out.close();

	}

	private static void solve15() throws IOException {

		int n = r.nextInt();
		int arr[] = r.nextIntArray(n);

		int dp[] = new int[n + 1];
		int tot = 0;
		for (int i = 0; i < n; i++) {
			if (arr[i] == 0) {
				dp[i + 1] = 1;
			} else {
				tot++;
				dp[i + 1] = -1;
			}
		}

		for (int i = 1; i <= n; i++) {
			dp[i] += dp[i - 1];
		}

		int max = Integer.MIN_VALUE;
		for (int i = n; i >= 1; i--) {
			for (int j = 1; j <= i; j++) {
				if (tot + dp[i] - dp[j - 1] > max) {
					max = tot + dp[i] - dp[j - 1];
				}
			}
		}

		out.print(max);
		out.close();

	}

	private static void solve16() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			int n = r.nextInt();
			int arr[] = r.nextIntArray(n);

			ArrayList<Integer> sub_seq = new ArrayList<Integer>();
			int i = 0;
			while (i < n) {
				int max = Integer.MIN_VALUE;
				while (i < n && arr[i] < 0) {
					max = Math.max(max, arr[i++]);
				}
				if (max != Integer.MIN_VALUE)
					sub_seq.add(max);
				max = Integer.MIN_VALUE;
				while (i < n && arr[i] > 0) {
					max = Math.max(max, arr[i++]);
				}
				if (max != Integer.MIN_VALUE)
					sub_seq.add(max);
			}
			long sum = 0;
			for (int ele : sub_seq) {
				sum += ele;
			}

			out.print(sum + "\n");

		}
		out.close();

	}

	private static void solve17() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			int n = r.nextInt();
			int arr[] = r.nextIntArray(n);

			Arrays.sort(arr);

			int max = Integer.MIN_VALUE, cnt = 0, ans = 0;
			for (int i = 0; i < n; i++) {
				max = Math.max(max, arr[i]);
				cnt++;
				if (max == cnt) {
					max = Integer.MIN_VALUE;
					cnt = 0;
					ans++;
				}
			}

			out.print(ans + "\n");

		}

		out.close();

	}

	private static void solve18() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			char str[] = r.next().toCharArray();

			TreeSet<Integer> one = new TreeSet<>();
			TreeSet<Integer> two = new TreeSet<>();
			TreeSet<Integer> three = new TreeSet<>();

			for (int i = 0; i < str.length; i++) {
				if (str[i] == '1') {
					one.add(i);
				} else if (str[i] == '2') {
					two.add(i);
				} else {
					three.add(i);
				}
			}

			int min = Integer.MAX_VALUE;

			for (int idx1 : one) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (two.higher(idx1) != null) {
					int idx2 = two.higher(idx1);
					if (three.higher(idx2) != null) {
						int idx3 = three.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (three.higher(idx1) != null) {
					int idx2 = three.higher(idx1);
					if (two.higher(idx2) != null) {
						int idx3 = two.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			for (int idx1 : two) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (one.higher(idx1) != null) {
					int idx2 = one.higher(idx1);
					if (three.higher(idx2) != null) {
						int idx3 = three.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (three.higher(idx1) != null) {
					int idx2 = three.higher(idx1);
					if (one.higher(idx2) != null) {
						int idx3 = one.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			for (int idx1 : three) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (two.higher(idx1) != null) {
					int idx2 = two.higher(idx1);
					if (one.higher(idx2) != null) {
						int idx3 = one.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (one.higher(idx1) != null) {
					int idx2 = one.higher(idx1);
					if (two.higher(idx2) != null) {
						int idx3 = two.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			if (min == Integer.MAX_VALUE) {
				min = 0;
			}

			out.println(min);

		}

		out.close();

	}

	private static void solve19() throws IOException {

		int n = r.nextInt();

		long arr[] = new long[n + 1];
		long sorted[] = new long[n + 1];

		for (int i = 1; i <= n; i++) {
			arr[i] = r.nextLong();
			sorted[i] = arr[i];
		}

		Arrays.sort(sorted);

		for (int i = 1; i <= n; i++) {
			arr[i] += arr[i - 1];
			sorted[i] += sorted[i - 1];
		}

		int m = r.nextInt();
		StringBuilder ans = new StringBuilder();

		while (m-- > 0) {

			int type = r.nextInt();
			int lt = r.nextInt();
			int rt = r.nextInt();

			long an = 0;
			if (type == 1) {
				an = arr[rt] - arr[lt - 1];
			} else {
				an = sorted[rt] - sorted[lt - 1];
			}
			ans.append(an).append("\n");

		}

		out.print(ans);
		out.close();

	}

	private static void solve20() throws IOException {

		int n = r.nextInt();
		long arr[] = r.nextLongArray(n);

		long dp[][] = new long[n][1 << n];
		for (int i = 0; i < n; i++) {
			Arrays.fill(dp[i], -1);
		}

		dp[0][0] = arr[0];
		dp[0][1] = -arr[0];

		for (int i = 1; i < n; i++) {
			int idx = 0;
			for (int j = 0; j < dp[i - 1].length; j++) {
				if (dp[i - 1][j] != -1) {
					dp[i][idx++] = dp[i - 1][j] + arr[i];
					dp[i][idx++] = dp[i - 1][j] - arr[i];
				} else {
					idx++;
				}
			}
		}

//		System.out.println(Arrays.toString(dp[n - 1]));

		boolean flag = false;
		for (int i = 0; i < dp[0].length; i++) {
			if (Math.abs(dp[n - 1][i]) % 360 == 0) {
				flag = true;
				break;
			}
		}

		out.print(flag ? "YES" : "NO");
		out.close();

	}

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

//		solve1();

//		solve2();

//		solve3();

//		solve4();

//		solve5();

//		solve6();

//		solve7();

//		solve8();

//		solve9();

//		solve10();

//		solve11();

//		solve12();

//		solve13();

//		solve14();

//		solve15();

//		solve16();

//		solve17();

//		solve18();

//		solve19();

		solve20();

	}

	static class Reader {

		final private int BUFFER_SIZE = 1 << 12;
		boolean consume = false;
		private byte[] buffer;
		private int bufferPointer, bytesRead;
		private boolean reachedEnd = false;

		public Reader() {
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = 0;
			bytesRead = 0;
		}

		public boolean hasNext() {
			return !reachedEnd;
		}

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

		private void consumeSpaces() throws IOException {
			while (read() <= ' ' && reachedEnd == false)
				;
			bufferPointer--;
		}

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

		public String next() throws IOException {
			StringBuilder sb = new StringBuilder();
			consumeSpaces();
			byte c = read();
			do {
				sb.append((char) c);
			} while ((c = read()) > ' ');
			if (consume) {
				consumeSpaces();
			}
			;
			if (sb.length() == 0) {
				return null;
			}
			return sb.toString();
		}

		public String nextLine() throws IOException {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str = br.readLine();
			return str;
		}

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

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

		public double nextDouble() throws IOException {
			consumeSpaces();
			double ret = 0;
			double div = 1;
			byte 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 (consume) {
				consumeSpaces();
			}
			if (neg) {
				return -ret;
			}
			return ret;
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextLong();
			}
			return a;
		}

		public int[][] nextIntMatrix(int n, int m) throws IOException {
			int[][] grid = new int[n][m];
			for (int i = 0; i < n; i++) {
				grid[i] = nextIntArray(m);
			}
			return grid;
		}

		public char[][] nextCharacterMatrix(int n) throws IOException {
			char[][] a = new char[n][];
			for (int i = 0; i < n; i++) {
				a[i] = next().toCharArray();
			}
			return a;
		}

		public void close() throws IOException {
			if (System.in == null) {
				return;
			} else {
				System.in.close();
			}
		}
	}

}

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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            Integer a = new Integer(in.nextInt());
            Integer[] num = new Integer[20];
            for (int i = 1; i <= a; ++i) {
                num[i] = new Integer(in.next());
            }
            for (int j = 0; j < (1 << a); ++j) {
                int sum = 0;
                int count = a, j1 = j;
                while (count > 0) {
                    if (j1 % 2 == 1) {
                        sum = sum + num[count];
                    } else {
                        sum = sum - num[count];
                    }
                    j1 /= 2;
                    count--;
                }
                if (sum % 360 == 0) {
                    out.println("YES");
                    return;
                }
            }
            out.println("NO");
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

import java.util.*;

public class square{

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

     for(int i=0;i<n;i++)a[i]=sc.nextInt();

    int m=1<<n;
    for(int i=0;i<m;i++)
    {
        int sum=0;
        for(int j=0;j<n;j++)
        {
if(((1<<j)&i)==0)sum+=a[j];
else sum-=a[j];
        }

        if(sum%360==0){System.out.println("YES");return;}
    }

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

import java.util.*;

public class Test {

    static int a[], n;

    static boolean solve(int i, int s){
        if(i==n && s!=0) return false;
        if(i==n && s==0) return true;
        return solve(i + 1, Math.abs(s + a[i]) % 360)||solve(i + 1, Math.abs(s - a[i]) % 360);
    }

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        a = new int[n];
        for(int i = 0; i<n; i++) a[i] = in.nextInt();
        System.out.println(solve(0, 0)?"YES":"NO");
    }

}

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

public class Main {
    public static boolean possible(int [] degrees,int total,int n){
        if (total%360==0){
            total=0;
        }
        if(n<0){
            if (total==0){
                return true;
            }
            return false;
        }
        else return possible(degrees,total+degrees[n],n-1) ||
                possible(degrees,total-degrees[n],n-1);
    }

    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int [] degrees = new int[n];
        for (int i=0;i<n;i++){
            degrees[i]=scanner.nextInt();
        }
        if(possible(degrees,0,n-1)){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }

    }

}

//static method recursion
import java.util.*;
public class Main
{
    public static boolean rec(int x, int n, int sum, int [] a)
    {
        if(x==n)
        {
            if(sum%360==0) return true;
            else return false;
        }
        boolean ans=false;
        ans=ans|rec(x+1,n,sum+a[x],a);
        ans=ans|rec(x+1,n,sum-a[x],a);
        return ans;
    }
    public static void main(String[] args)
    {
        Scanner sc= new Scanner(System.in);
        int t=1;
        //t=sc.nextInt();
        while(t>0)
        {
            int n=sc.nextInt();
            int [] a= new int [n];
            for(int i=0 ; i<n ; i++)
            {
                a[i]=sc.nextInt();
            }
            if(rec(0,n,0,a)==true)
            {
                System.out.println("YES");
            }
            else
            {
                System.out.println("NO");
            }
            t--;
        }
    }
}

//referenced from trogdor

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

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

        int n = sc.nextInt();
        int[] movements = new int[n];

        for (int i = 0; i < n; i++) {
            movements[i] = sc.nextInt();
        }

        System.out.println(combinationLock(movements, 0, 0) ? "YES" : "NO");
    }

    public static boolean combinationLock(int[] movements, int index, int currSum) {
        if (index == movements.length) {
            return currSum == 0 || currSum % 360 == 0;
        }
        int sum1 = currSum + movements[index];
        int sum2 = currSum - movements[index];
        return combinationLock(movements, index+1, sum1) || combinationLock(movements, index+1, sum2);
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author real
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int ar[] = in.nextIntArray(n);
            for (int i = 0; i < (1 << n); i++) {
                int sum = 0;
                for (int j = 0; j < n; j++) {
                    if ((i & (1 << j)) != 0) {
                        sum += ar[j];
                    } else {
                        sum -= ar[j];
                    }
                }
                sum=sum%360;
                sum += 360;
                sum=sum%360;
                if (sum % 360 == 0) {
                    out.print("YES");
                    return;
                }
            }
            out.print("NO");
        }

    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            //*-*------clare------
//remeber while comparing 2 non primitive data type not to use ==
//remember Arrays.sort for primitive data has worst time case complexity of 0(n^2) bcoz it uses quick sort
//again silly mistakes ,yr kb tk krta rhega ye mistakes
//try to write simple codes ,break it into simple things
            // for test cases make sure println(); ;)
//knowledge>rating
        /*
        public class Main
        implements Runnable{
    public static void main(String[] args) {
        new Thread(null,new Main(),"Main",1<<26).start();

    }
    public void run() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();//chenge the name of task
        solver.solve(1, in, out);
        out.close();
    }
         */

            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

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

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

import java.util.*;

public class Program {
	public static void main(String []args) {
Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		List<Integer> lst = new ArrayList<Integer>();
		while(t>0) {
			lst.add(sc.nextInt());
			t--;
		}

		int sum = lst.get(0);
		int sum1 = lst.get(0);
		int sum2 = lst.get(0);
		int sum3 = lst.get(0);
		boolean flag = true;
		List<Integer> m = new ArrayList<Integer>();
		m.add(lst.get(0));
		for(int i=1;i<lst.size();i++) {
			int k = lst.get(i);
			 sum+=k;
			 sum1-=k;
			 if(flag) {
				 flag = false;
				 sum2+=k;
			 } else {
				 flag = true;
				 sum2-=k;
			 }
			 List<Integer> newLst = new ArrayList<Integer>();
			 for(int j=0;j<m.size();j++){
			     int a = m.get(j);
			     //m.remove(j);
			     newLst.add(a+k);
			     newLst.add(a-k);

			 }
			 m.clear();
			 m.addAll(newLst);

			 //System.out.println(Arrays.toString(m.toArray()));
		}

		for(int i=0;i<m.size();i++){
		    //	System.out.print(m.get(i)+", ");
		    if(m.get(i)==0 || m.get(i)%360==0){
		        System.out.println("YES");
		        return;
		    }
		}

		if(sum == 0 || sum % 360 == 0 || sum1 == 0 || sum1%360 == 0 || sum2 == 0 || sum2 % 360 == 0 || sum3 ==0 || sum3 == 360) {
			System.out.print("YES");
		} else {
			System.out.print("NO");
		}
	}
}

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

public class PetrAndCombinationLock{

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine().trim());
        int sum=0, j=0;
        int a[] = new int[n];
        while(j<n){
            int v = Integer.parseInt(br.readLine().trim());
            a[j] = v;
            j++;
        }
        if(isPossible(a, 0, 0)){
            System.out.println("YES");
        }else
            System.out.println("NO");
    }

    private static boolean isPossible(int a[], int i, int sum) {

        if(i==a.length && sum%360==0)return true;
        if(i==a.length)return false;

        return isPossible(a, i+1, sum+a[i]) || isPossible(a, i+1, sum-a[i]);

    }

}

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

/**
 * Created by Andrey on 30.12.2018.
 */
public class Test {

    static ArrayList<String> vars = new ArrayList<>();
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];

        for(int i = 0; i < n; ++i){
            arr[i] = sc.nextInt();
        }

        solve(arr,0,0);

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

    }

    static void solve(int[] arr, int i, int sum){

        if(i != arr.length) {
            solve(arr, i + 1, sum + arr[i]);
            solve(arr, i + 1, sum - arr[i]);
        }else{
            if(sum % 360 == 0){
                vars.add("YES");
            }else{
                vars.add("NO");
            }
        }
    }

}

import java.util.*;
public class Main
{

    public static boolean backtrack(int arr[], int sum , int i, int n)
    {
        if(i==n && (sum==0 || sum%360==0))
        {
            return true;
        }
        if(i==n)
            return false;
       return  backtrack(arr, sum+arr[i], i+1, n) || backtrack(arr, sum-arr[i], i+1, n);
    }
    public static void main(String args[])
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int arr[] = new int[n];
        for(int i=0;i<n;i++)
            arr[i]=scan.nextInt();
        if(backtrack(arr, 0, 0, n))
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}

import java.util.Arrays;
import java.util.Scanner;
//█░░█ █▀▀█ █▀▀█ █▀▀█ █░░█ █▀▀▄ █▀▀ █░░░█ █░░█ █▀▀ █▀▀█ █▀▀█
//█▀▀█ █▄▄█ █░░█ █░░█ █▄▄█ █░░█ █▀▀ █▄█▄█ █▄▄█ █▀▀ █▄▄█ █▄▄▀
//▀░░▀ ▀░░▀ █▀▀▀ █▀▀▀ ▄▄▄█ ▀░░▀ ▀▀▀ ░▀░▀░ ▄▄▄█ ▀▀▀ ▀░░▀ ▀░▀▀

public class Main {

    static int n;
    static int A[];

    static public boolean f(int sum, int id) {
//        System.out.println(sum+" "+id);
        if ((sum%360==0||sum == 0) && id == n) {
            return true;
        }

        if(id>n)return false;
        boolean rta = false;
        for (int i = id; i<n; i++) {
            return f(sum + A[i], i+1) || f(sum - A[i], i+1);
        }
        return rta;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        A=new int[n];
        int B[]=new int[n];
        long sum=0;
        for (int i = 0; i < n; i++) {
            B[i]=sc.nextInt();
            sum+=B[i];
        }
        Arrays.sort(B);
        A=B;
        if(sum%360==0){
            System.out.println("YES");
        }else{
            boolean rta=f(0,0);
            if(rta){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
}

import java.io.BufferedInputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        PrintStream out = System.out;

        int n = cin.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
            arr[i] = cin.nextInt();
        boolean ok = false;
        for (int cur = 0; cur < (1 << n); cur++) {
            int sum = 0;
            for (int i = 0; i < n; i++)
//                sum += arr[i] * ( (cur&(1 << i)) != 0 ? 1 : -1);
                sum += arr[i] * ((1 & (cur >> i)) != 0 ? 1 : -1); // 和上面一行等价
            if (sum % 360 == 0) {
                ok = true;
                break;
            }
        }
        out.println(ok ? "YES" : "NO");
    }
}

import java.util.Scanner;

public class PetrePetrolLock {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }
        int pow = (int) (Math.pow(2, n));
        for(int i=0;i<pow;i++){
            String bits = Integer.toBinaryString(i);
            if(bits.length()!=n){
                int diff = n-bits.length();
                while(diff-->0){
                    bits="0"+bits;
                }
            }
            //System.out.println(bits);
            int j;
            long sum=0;
            for(j=0;j<n;j++){
                if(bits.charAt(j)=='1'){
                    sum+=arr[j];
                }else{
                    sum-=arr[j];
                }
                //System.out.print(sum);
            }
            //System.out.println();
            if(sum==0 || sum%360==0){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }
}

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int[] a = new int[n];

        for(int i=0; i<n; i++) {
            a[i] = sc.nextInt();
        }

        int x;
        boolean yes = false;

        for(int i=0; i<Math.pow(2, n); i++) {

            String s = String.format("%015d", Long.parseLong(Integer.toBinaryString(i)));
            x = 0;

            for(int j=15-n, k=0; j<15; j++, k++) {

                if(s.charAt(j)=='0') {
                    x -= a[k];
                }
                else {
                    x += a[k];
                }
            }
            if(x == 0 || x == 360 || x==720 || x==1080 || x==1440 || x==1800 || x==2160 || x==2520 || x==2880) {
                yes = true;
                break;
            }
        }
        if(yes) {
            System.out.println("YES");
        }
        else {
            System.out.println("NO");
        }
    }

}

import java.util.*;
public class PetrAndACombinationLock {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=new int[n];
		ArrayList<Integer> foo=new ArrayList<>();
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		if(n==1) {
			if(arr[0]==0 || arr[0]==360) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		foo.add(arr[0]+arr[1]);
		foo.add(arr[0]-arr[1]);
		if(n==2) {
			if(foo.contains(0) || foo.contains(360)) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		int k=2,r=2;
		for(int i=0;i<Math.pow(2, n-2);i++) {
			for(int j=0;j<r;j++) {
				//System.out.println(k);
				foo.add(foo.get(0)+arr[k]);
				foo.add(foo.get(0)-arr[k]);
				foo.remove(0);
			}
			r=r*2;
			k++;
			if(k==n) {
				break;
			}
		}
		//System.out.println(foo.size()+"bhai");
		boolean isit=false;
		for(int i=0;i<foo.size();i++) {
			if(foo.get(i)%360==0) {
				isit=true;
				break;
			}
		}
		//for(int i=0;i<foo.size();i++) {
			//System.out.println(foo.get(i));
		//}
		if(foo.contains(0) || foo.contains(360) || isit) {
			//System.out.println("////");
			//System.out.println(foo.indexOf(0));
			//System.out.println(foo.indexOf(360));
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

import java.util.Scanner;

public class PetrCombinationLock {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        if (fn(arr, 0, true, 0) || fn(arr, 0, false, 0)) System.out.println("YES");
        else System.out.println("NO");
    }

    private static boolean fn(long[] arr, int i, boolean plus, long curr) {
        if (i >= arr.length) {
            if (curr == 0 || curr % 360 == 0) return true;
            else return false;
        }
        if (plus) curr += arr[i];
        else curr -= arr[i];
        return fn(arr, i + 1, true, curr) || fn(arr, i + 1, false, curr);
    }
}

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

public class Petr_and_a_Combination_Lock
{
	public static void main(String[] args)throws Throwable
	{
		BufferedReader bf = new BufferedReader(new InputStreamReader (System.in));
		int count=Integer.parseInt(bf.readLine());
		int [] nums = new int [count];
		for(int i=0;i<count;i++)
			nums[i]=Integer.parseInt(bf.readLine());
		System.out.println(solve(nums,0,0)? "YES":"NO");
	}
	public static boolean solve(int [] nums,int total,int i)
	{
		if(i==nums.length)
		{
			if(total%360==0)
				return true;
			else
				return false;
		}
		return solve(nums,total+nums[i],i+1) || solve(nums,total-nums[i],i+1);
	}
}

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

public class PetrandaCombinationLock {

    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) {
        FastReader fr=new FastReader();
        int n=fr.nextInt();
        int an[]=new int[n];

        for(int i=0;i<n;i++)
            an[i]=fr.nextInt();

//        int sum=0,in=0;
//        for(int i=0;i<n;i++)
//        {
//            an[i]=fr.nextInt();
//            sum+=an[i];
////            if(sum>360)
////            {
////                sum=0;
////                in=i;
////                //System.out.println(in);
////            }
//            if(sum==360)
//            {
//                sum=0;
//                in=i+1;
//            }
//        }
//
//        if(in==an.length&&sum==0)
//        {
//            System.out.println("YES");
//            return;
//        }
//
          boolean possible=false;
//
//        Arrays.sort(an,in,n);
//
//        int csum[]=new int[n-in+1];
//
//        csum[0]=0;
//        for(int i=in,j=1;i<n;i++,j++)
//        {
//
//
//
//
//               if(an[i]==csum[j-1])
//                   csum[j]=0;
//               else if(i!=0&&an[i]==an[i-1])
//               {
//                   csum[j]=csum[j-2];
//                   csum[j-1]=csum[j-2];
//               }
//               else
//               csum[j]=an[i]+csum[j-1];
//
//
//        }
//
//
//        for(int i=0;i<csum.length;i++)
//        {
//            if(csum[i]==(csum[csum.length-1]-csum[i]))
//            {
//                possible=true;
//                break;
//            }
//        }

        int limit=(int)Math.pow(2,n);

        for(int i=0;i<Math.pow(2,n);i++)
        {
           String  s=getBinaryRep(i,n);

           int sum=0;
            for(int j=0;j<n;j++)
            {
                if(s.charAt(j)=='0')
                {
                    sum+=an[j];
                }
                else sum-=an[j];

            }
            if(sum%360==0)
            {

                System.out.println("YES");
                return;
            }
        }

         System.out.println("NO");

    }

    static String getBinaryRep(int n,int l)
    {
        String s="";
        while (n>0)
        {
            int r=n%2;
            s+=String.valueOf(r);
            n=n/2;
        }

        int len=s.length();
        for(int i=0;i<l-len;i++)
        {

            s+='0';

        }

        char c[]=s.toCharArray();
        for(int i=0;i<s.length()/2;i++)
        {
            char temp=c[i];
            c[i]=c[s.length()-1-i];
            c[s.length()-i-1]=temp;
        }

        return new String(c);
    }
}

import java.util.*;

public class Main {
static class p{
	int x;int y;
	p(int x,int y){
		this.x=x;this.y=y;
	}
}
static class sort implements Comparator<p>{
	public int compare(p p1,p p2) {
		if(p1.x!=p2.x)
			return p1.x-p2.x;
		return p1.y-p2.y;
	}
}
    public static void main (String[] args) {
    Scanner s=new Scanner(System.in);
   int n=s.nextInt();
   int a[]=new int[n];
   int sum=0;
   for(int i=0;i<n;i++) {
	   a[i]=s.nextInt();sum+=a[i];
   }
   boolean d=false;
   if(sum%2!=0) {
	   System.out.println("NO");
	   return;
   }
    int dp[][]=new int[n+1][sum/2+1];
    for(int i=0;i<=n;i++)
    	for(int j=0;j<=sum/2;j++)
    		dp[i][j]=-1;
    int xx=ans1(a,0,n,0);
    if(xx==1)
    	System.out.println("YES");
    else
    	System.out.println("NO");
    }
    public static int ans1(int a[],int i,int n,int j) {
    	if(i==n) {
    		if(j<0)
    			j=-j;
    		//System.out.println(j);
    		if(j%360==0)
    			return 1;
    		return 0;
    	}
    	return Math.max(ans1(a,i+1,n,j+a[i]),ans1(a,i+1,n,j-a[i]));
    }
    public static int ans(int dp[][],int n,int m,int i,int j,int a[]) {
    	if(i==n) {
    		if(j==m)
    			return 1;
    		return 0;
    		}
    	if(j>m)
    		return 0;
    	if(j==m)
    		return 1;
    	if(dp[i][j]!=-1)
    		return dp[i][j];
    	//System.out.println(i+" "+j+" "+a[i]);
    	dp[i][j]=Math.max(ans(dp,n,m,i+1,j+a[i],a),ans(dp,n,m,i+1,j,a));
    	return dp[i][j];
    }

}

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

public class CombinationLock {
    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;
        }
    }

    static <T> void printArray(T[] arr) {
        for (T x : arr)
            print(x, " ");
        printn("");
    }

    static <T> void print(T s, String sep) {
        System.out.print(s + sep);
    }

    static <T> void printn(T s) {
        System.out.println(s);
    }

    static Long[] inputArrL(int n, FastReader fr) {
        Long[] arr = new Long[n];
        for (int i = 0; i < n; i++)
            arr[i] = fr.nextLong();
        return arr;
    }

    static Integer[] inputArr(int n, FastReader fr) {
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++)
            arr[i] = fr.nextInt();
        return arr;
    }

    static int max(int... args) {
        int max = Integer.MIN_VALUE;
        for (int x : args) {
            max = Math.max(x, max);
        }
        return max;
    }

    static int min(int... args) {
        int min = Integer.MAX_VALUE;
        for (int x : args) {
            min = Math.min(x, min);
        }
        return min;
    }

    static int lenDigit(int d) {
        if (d == 0)
            return 1;
        int l = 0;
        while (d != 0) {
            l++;
            d /= 10;
        }
        return l;
    }

    static boolean isExist(int n, int arr[], int idx, int currRot, int[][] dp){
        boolean res;
        if(idx == n){
            if(currRot == 0 || currRot == 360 || currRot % 360 == 0)
                return true;
            else
                return false;
        }
        if (currRot >= 0 && dp[idx][currRot] != -1)
            return dp[idx][currRot] == 1;
        else if(currRot < 0 && dp[idx][180 * 15 + (-1 * currRot)] != -1)
            return dp[idx][180 * 15 + (-1 * currRot)] == 1;
        else
            res = (isExist(n, arr, idx + 1, currRot + arr[idx], dp) || isExist(n, arr, idx + 1, currRot - arr[idx], dp));
        if(res) {
            if (currRot >= 0) {
                dp[idx][currRot] = 1;
            } else {
                dp[idx][180 * 15 + (-1 * currRot)] = 1;
            }
        }
        else{
            if (currRot >= 0) {
                dp[idx][currRot] = 0;
            } else {
                dp[idx][180 * 15 + (-1 * currRot)] = 0;
            }
        }
        return res;
    }

    public static void main(String[] args) {
        FastReader fr = new FastReader();
        int n = fr.nextInt();
        int[] rots = new int[n];
        int max = 2 * 180 * 15;
        int[][] dp = new int[n+1][max];
        for(int[] x: dp)
            Arrays.fill(x, -1);
        for(int i=0; i<n; i++)
            rots[i] = fr.nextInt();
        boolean res = isExist(n, rots, 0, 0, dp);
        if(res)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}

import java.io.IOException;
import java.util.Scanner;

public class Main {
    static int n;
    static int[] a;
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        a = new int[n];
        for(int i=0;i<n;i++)
            a[i] = in.nextInt();
        System.out.println(combination(0,0)?"YES":"NO");
    }
    public static boolean combination(int Csum, int indx) {
        if(indx== a.length)
            return Csum == 0 || Csum % 360 == 0;
        int sum1 = Csum + a[indx];
        int sum2 = Csum - a[indx];
        return combination(sum1, indx+1)|| combination(sum2,indx+1);
    }
}

import java.io.BufferedInputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {

    static boolean recur(int[] arr, int i, int sum){
        if(i == arr.length)
            return sum % 360 == 0 ? true : false;
        return recur(arr, i+1, sum+arr[i]) || recur(arr, i+1, sum-arr[i]);
    }

    public static void main(String[] args) {

        Scanner cin = new Scanner(new BufferedInputStream(System.in));
        PrintStream out = System.out;
        int n = cin.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
            arr[i] = cin.nextInt();
        boolean ok = recur(arr, 0,0);
        out.println(ok ? "YES" : "NO");
    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
* @author madi.sagimbekov
*/
public class C1097B {

private static BufferedReader in;
private static BufferedWriter out;

private static List<Integer>[] list;
private static int[] arr;
private static int[][] dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
private static boolean[] used;

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

int n = readInt();
int[] a = new int[n];

int sum = 0;
for (int i = 0; i < n; i++) {
a[i] = readInt();
sum += a[i];
}

if (sum % 360 == 0) {
out.write("YES\n");
close();
return;
} else if (sum % 2 == 0) {

for (int i = 0; i <= (1 << 16); i++) {
int temp = 0;
int ind = 0;
int num = i;
while (num > 0 && ind < n) {
if ((num & 1) == 1) {
temp += a[ind];
}
ind++;
num >>= 1;
}

if (Math.abs(temp * 2 - sum)==0) {
out.write("YES\n");
close();
return;
}
}
}

out.write("NO\n");
close();
}

private static int[] readInts() throws IOException {
return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
}

private static int readInt() throws IOException {
return Integer.parseInt(in.readLine());
}

private static long[] readLongs() throws IOException {
return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
}

private static long readLong() throws IOException {
return Long.parseLong(in.readLine());
}

private static double[] readDoubles() throws IOException {
return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
}

private static double readDouble() throws IOException {
return Double.parseDouble(in.readLine());
}

private static String readString() throws IOException {
return in.readLine();
}

private static List<Integer>[] buildAdjacencyList(int n, int m) throws IOException {
List<Integer>[] list = new ArrayList[n + 1];
for (int i = 0; i <= n; i++) {
list[i] = new ArrayList<>();
}

for (int i = 0; i < m; i++) {
int[] e = readInts();
list[e[0]].add(e[1]);
list[e[1]].add(e[0]);
}

return list;
}

private static void open() {
in = new BufferedReader(new InputStreamReader(System.in));
out = new BufferedWriter(new OutputStreamWriter((System.out)));
}

private static void close() throws IOException {
out.flush();
out.close();
in.close();
}

}

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

	public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       int n=sc.nextInt();
              int pow=(int)Math.pow(2,n);

       int arr[]=new int[n+1];
       for(int i=0;i<n;i++){
       	arr[i]=sc.nextInt();
       }
       int brr[]=new int[2*pow+3];
       brr[0]=arr[0];
       for(int i=0;i<n;i++){
       	if(i!=n-1){

          brr[2*i+1]=brr[i]+arr[i+1];
          brr[2*i+2]=brr[i]-arr[i+1];
      }else{
 brr[2*i+1]=brr[i]+arr[i];
          brr[2*i+2]=brr[i]-arr[i];      }
       }
              int pow2=(int)Math.pow(2,n-1);

       for(int i=n;i<=pow-2;i++){
       	 brr[2*i+1]=brr[i]+brr[i+1];
          brr[2*i+2]=brr[i]-brr[i+1];
       }

       for(int i=pow-2;i>=pow2;i--){
       	//System.out.println(brr[i]);
       	if(brr[i]%360==0){
       		System.out.println("YES");
       		break;
       	}

       }
       System.out.println("NO");
 // for(int i=0;i<=pow-2;i++){
 // 	System.out.print(brr[i]+" ");
 // }

	}

}

import java.util.*;
public class JavaApplication14 {
    public static void main(String[] args) {
        Scanner io = new Scanner(System.in);
        int n = io.nextInt();
        int deg[] = new int[n];
        for(int i = 0; i < n; i++)
            deg[i] = io.nextInt();
        if(n == 1 || (n == 2 && deg[0] != deg[1])) {
            System.out.println("NO");
            return;
        } if(n == 2 && deg[0] == deg[1]) {
            System.out.println("YES");
            return;
        }
        if(rec(0, deg, 0) >= 5000)
            System.out.println("YES");
        else
            System.out.println("NO");
    }

    public static int rec(int sum, int[] deg, int index) {
        while(sum >= 360) sum -= 360;
        if(index >= deg.length) {
            if(sum == 0)
                return Integer.MAX_VALUE;
            else
                return sum;
        }
        return Math.max(rec(sum+deg[index], deg, index+1), rec(sum-deg[index], deg, index+1));
    }
}

import java.util.*;
import java.util.stream.*;

public class c1097B
{
	static boolean set(int a[],int i,int tot)
	{
		if(tot==0)
		{
			return true;
		}
		else if(i<0)
		{
			return false;
		}
		else
		{
			return set(a,i-1,tot)||set(a,i-1,tot-a[i]);
		}
	}
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=Integer.parseInt(sc.nextLine());
		int num[]=new int[a];
		for(int i=0;i<a;i++)
		{
			num[i]=Integer.parseInt(sc.nextLine());
		}
		int sum=IntStream.of(num).sum();
		if(sum%2!=0)
		{
			System.out.println("NO");
		}
		else
		{
			if(set(num,num.length-1,sum))
			{
				System.out.println("YES");
			}
			else
			{
				System.out.println("YES");
			}
		}
	}
}

import java.util.*;
import java.io.*;
public class A
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
    static StringTokenizer st=null;
    static String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try{
                st=new StringTokenizer(br.readLine());
            } catch (IOException e){
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    static int nextInt()
    {
        return Integer.parseInt(next());
    }
    static long nextLong()
    {
        return Long.parseLong(next());
    }

    static double nextDouble(){
        return Double.parseDouble(next());
    }
   public static void main(String[] args) {
        try{
             int n=nextInt();
             int a[]=new int[n];
             TreeSet<Integer> ts=new TreeSet<>();
             int sum=0;
             for(int i=0;i<n;i++)
             {
                 a[i]=nextInt();
                 sum+=a[i];
             }
             TreeSet<Integer> temp=new TreeSet<>();
             for(int i=0;i<n;i++)
             {
              //   bw.write("i="+i+" ts="+ts.toString()+"\n");
                 Iterator it=ts.iterator();
                 while(it.hasNext())
                 {
                     int x=(int)it.next();
                     temp.add((x+a[i]));
                 }
                 ts.add(a[i]);
                 it=temp.iterator();
                 while(it.hasNext())
                 {
                     int x=(int)it.next();
                     ts.add(x);
                 }
               //  bw.write("i="+i+" temp="+temp.toString()+" \nts="+ts.toString()+"\n\n");
                 temp.clear();
             }
             int flag=0;
             if(sum<360)
             {
                 int sum2=0;
                 for(int i=0;i<n;i++)
                 {
                     sum2+=a[i];
                     if(sum2==(sum-sum2))
                     {
                        flag++;
                        break;
                     }
                 }
             }
             else if(sum==360)
             {
                 flag++;
             }
             else
             {
                 int rem=(sum%360);
                 if(rem%2==0)
                 {
                     rem/=2;
                     if(ts.contains(rem)==true)
                     {
                         flag++;
                     }
                 }
             }
             if(flag>0)
             {
                 bw.write("YES\n");
             }
             else
             {
                 bw.write("NO\n");
             }
		bw.flush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

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

public class CP{
  public static OutputStream out=new BufferedOutputStream(System.out);
  static Scanner sc=new Scanner(System.in);
  static long mod=1000000007l;
  static int INF=1000000;

  //nl-->neew line; //l-->line;  //arp-->array print;  //arpnl-->array print new line
  public static void nl(Object o) throws IOException{out.write((o+"\n").getBytes()); }
  public static void l(Object o) throws IOException{out.write((o+"").getBytes());}
  public static void arp(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+" ").getBytes()); out.write(("\n").getBytes());}
  public static void arpnl(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+"\n").getBytes());}
  public static void scanl(long[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextLong();}
  public static void scani(int[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextInt();}
  public static void scan2D(int[][] a,int n,int m) {for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=sc.nextInt();}
  //
  static long cnt;
  static TreeSet<Integer> ans;
  static int n,m;
  static boolean[][] dp,vis;
  static HashMap<Pair,Boolean> arrl;
  static Stack<Integer> stk;
  static Queue<Integer> queue;
  static HashSet<Integer> mtrnode;
  static ArrayList<Integer> arrlans;

  public static void main(String[] args) throws IOException{
    long sttm=System.currentTimeMillis();
    long mod=1000000007l;

    int n=sc.nextInt();
    int[] a=new int[n];
    scani(a,n);
    int sum=0;
    for(int ai:a){
        sum+=ai;
    }
    if(sum%2==1){
        nl("NO");
    }
    else{
        boolean pos=solve(a,(sum%360)/2,0,n);
        pos|=solve(a, sum/2, 0,n);
        if(pos)nl("YES");
        else nl("NO");
    }

    out.flush();
  }

  public static boolean solve(int[] a, int sum, int st, int n){
      if(sum==0){
          return true;
      }
      if(st==n) return false;

      return solve(a,sum,st+1,n) || solve(a, sum-a[st], st+1, n);
  }

  public static long sum(long n){
      return (n*(n+1))/2;
  }

}

class Pair{
  int x,y;
  Pair(int x,int y){
    this.x=x;
    this.y=y;
  }
}

import java.io.*;
public class Combination_Lock {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		int sum = 0;
		for (int i = 0;i<n;i++)
		{
			arr[i] = Integer.parseInt(br.readLine());
			sum += arr[i];
		}
		if (sum%360==0)
		{
			System.out.println("YES");
		}
		else if(sum%2!=0)
		{
			System.out.println("NO");
		}
		else
		{
			sum = sum/2;
			boolean[][] dp = new boolean[n][sum+1];
			for (int i=0;i<dp.length;i++)
			{
				for (int j=0;j<dp[0].length;j++)
				{
					if (j==0)
						dp[i][j] = true;
					else if(i==0)
						dp[0][j] = arr[0]==j;
					else if (j<arr[i])
						dp[i][j] = dp[i-1][j];
					else
						dp[i][j] = dp[i-1][j]||dp[i-1][j-arr[i]];
				}
			}
			System.out.println(dp[n-1][sum]?"YES":"NO");
		}

	}

}

import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
import java.math.*;
public class B {
	public static void main(String[] args)throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int arr[] = new int[n];
		for(int i=0; i<n; ++i) {
			arr[i] = sc.nextInt();
		}
		boolean dp[][] = new boolean[n+1][180];
		dp[0][0] = true;
		for(int i=0; i<n; ++i) {
			for(int j=0; j<180; ++j) {
				if(dp[i][j]) {
					dp[i+1][(j+arr[i])%180] = true;
					dp[i+1][(j-arr[i]+180)%180] = true;
				}
			}
		}
		if(dp[n][0]) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		out.close();
	}
	static class FastIO {
		InputStream dis;
		byte[] buffer = new byte[1 << 17];
		int pointer = 0;
		public FastIO(String fileName) throws IOException {
			dis = new FileInputStream(fileName);
		}
		public FastIO(InputStream is) throws IOException {
			dis = is;
		}
		int nextInt() throws IOException {
			int ret = 0;

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}

			return (negative) ? -ret : ret;
		}
		long nextLong() throws IOException {
			long ret = 0;

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}
			return (negative) ? -ret : ret;
		}
		byte nextByte() throws IOException {
			if (pointer == buffer.length) {
				dis.read(buffer, 0, buffer.length);
				pointer = 0;
			}
			return buffer[pointer++];
		}
		String next() throws IOException {
			StringBuffer ret = new StringBuffer();

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			while (b > ' ') {
				ret.appendCodePoint(b);
				b = nextByte();
			}

			return ret.toString();
		}
	}
}

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

public class A {

    public static void main(String[] args) throws Exception {
        // FileInputStream inputStream = new FileInputStream("input.txt");
        // FileOutputStream outputStream = new FileOutputStream("output.txt");

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Solver solver = new Solver();
        // int t = in.nextInt();
        int t = 1;
        for (int i = 0 ; i < t ; i++) {
            solver.solve(1, in, out);
        }

        out.close();
    }

    static class Solver {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            boolean[][] can = new boolean[n + 1][6000];
            can[0][3000] = true;
            for (int i = 1 ; i <= n ; i++) {
                int x = in.nextInt();
                for (int j = 0 ; j < 6000 ; j++) {
                    if (can[i - 1][j]) {
                        can[i][j - x] = can[i][j + x] = true;
                    }
                }
            }
            if (can[n][3000]) out.println("YES"); else out.println("NO");
        }
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

        public float nextFloat() {
            return Float.parseFloat(next());
        }
    }
}

import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Short.parseShort;
import static java.lang.Byte.parseByte;
import java.io.*;
import java.util.*;

public class Contest {

    static int nextInt() throws IOException {
        return parseInt(next());
    }

    static long nextLong() throws IOException {
        return parseLong(next());
    }

    static short nextShort() throws IOException {
        return parseShort(next());
    }

    static byte nextByte() throws IOException {
        return parseByte(next());
    }

    static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens())
            tok = new StringTokenizer(in.readLine());
        return tok.nextToken();
    }

    static String nextLine() throws IOException {
        return in.readLine();
    }

    private static BufferedReader in;
    private static StringTokenizer tok;
    private static PrintWriter out = new PrintWriter(System.out);
    private static Utilities doThis = new Utilities(out);
    private static MyMath doMath = new MyMath();

    public static void main(String[] args) throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));

        /*--------------------SolutionStarted-------------------*/
        solve();
        /*--------------------SolutionEnded--------------------*/

        in.close();
        out.close();
    }

    static int n, m, k,
            count = 0, length = 0, sum = 0,
            q, t,
            idx, temp;
    static char[] s, s1;
    static int max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
    static long lMax = Long.MAX_VALUE, lMin = Long.MIN_VALUE, lSum = 0, lCount;
    static int[] nums;
    static boolean flag;

    static void solve() throws IOException {
        n = nextInt();
        nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = nextInt();
        }
        doDeep(0, nums, 0, "");
        doThis.no();
    }

    static void doDeep(int degree, int[] rotations, int idx, String str) {
        //out.println(degree+" "+idx);
        if (idx == rotations.length) {
            if (Math.abs(degree) == 0||Math.abs(degree)==360) {
                doThis.yes();
               // out.println(str);
                out.close();
               System.exit(0);
            }
        }else {
            doDeep((degree - rotations[idx] % 360), rotations, idx+1, str+"-");
            doDeep((degree + rotations[idx] % 360), rotations, idx+1, str+"+");
        }
    }
}
class Pair implements Comparable<Pair>{
    int k,v;
    boolean taken;
    Pair(int k,int v){
        this.k = k;
        this.v =v;
    }

    @Override
    public int compareTo(Pair o) {
        return v-o.v;
    }
}
class CharPair{
    char ch;
    int value;
    CharPair(char c, int v){
        ch =c; value=v;
    }
    char get(){
        return ch;
    }
}
class IntPair implements Comparable<IntPair> {
    int key, value;
    IntPair(int key, int value) {
        this.key =  key;
        this.value = value;
    }

    @Override
    public int compareTo(IntPair o) {
        if (value == o.value)
            return key - o.key;
        return value - o.value;
    }

    public String toString() {
        return key + " " + value;
    }
}
class BooleanPair {
    boolean key, value;

    BooleanPair() {
    }

    BooleanPair(boolean key, boolean value) {
        this.key = key;
        this.value = value;
    }
}
class Utilities {
    PrintWriter out;
    Utilities(PrintWriter out){
        this.out = out;
    }
    //int arrays start
    int lowerBound(int[] arr, int low, int high, int element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(int[] arr, int low, int high, int element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //int arrays end
    //long arrays start
    int lowerBound(long[] arr, int low, int high, long element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(long[] arr, int low, int high, long element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //long arrays end
    //double arrays start
    int lowerBound(double[] arr, int low, int high, double element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(double[] arr, int low, int high, double element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //double arrays end
    int arrUp(int [][]arr,int i, int j){
        if(i==0)
            return Integer.MIN_VALUE;
        return arr[i-1][j];
    }
    int arrDown(int [][]arr,int i, int j){
        if(i==arr.length-1)
            return Integer.MIN_VALUE;
        return arr[i+1][j];
    }
    int arrLeft(int [][]arr,int i, int j){
        if(j==0)
            return Integer.MIN_VALUE;
        return arr[i][j-1];
    }
    int arrRight(int [][]arr,int i, int j){
        if(j==arr[i].length-1)
            return Integer.MIN_VALUE;
        return arr[i][j+1];
    }
    int count(char[] s, char c){
        int count = 0;
        for (int i = 0; i < s.length; i++) {
            if (s[i]==c)
                count++;
        }
        return count;
    }
    void swap(char[] s, int a,int b){
        char temp =s[b];
        s[b]= s[a];
        s[a] = temp;
    }
    boolean odd(int a){
        return (a&1)==1;
    }
    boolean even(int a){
        return (a&1)==0;
    }
    void yes(){
        out.println("YES");
    }
    void no() {
        out.println("NO");
    }
    void bad(){
        out.println(-1);
    }
    void printBinary(int num){
        out.println(Integer.toBinaryString(num));
    }
}
class MyMath {
    boolean isCoPrime(int a, int b) {
        return gcd(a, b) == 1;
    }

    int gcd(int a, int b) {
        if (a == 0)
            return b;
        while (b != 0)
            if (a > b)
                a = a - b;
            else
                b = b - a;
        return a;
    }

    int log2(int x) {
        return (int) (Math.log(x) / Math.log(2));
    }
    boolean[] sieveOfEratosthenes(int n)
    {
        // Create a boolean array "primes[0..n]" and initialize
        // all entries it as true. A value in primes[i] will
        // finally be false if i is Not a primes, else true.
        boolean primes[] = new boolean[n+1];
        for(int i=0;i<n;i++)
            primes[i] = true;

        for(int p = 2; p*p <=n; p++)
        {
            // If primes[p] is not changed, then it is a primes
            if(primes[p])
            {
                // Update all multiples of p
                for(int i = p*p; i <= n; i += p)
                    primes[i] = false;
            }
        }
        return primes;
    }
}
class Bitmasks{
    static byte andBitmask(byte state, byte... masks){
        byte temp=0;
        for (int i = 0; i < masks.length; i++) {
            temp|=masks[i];
        }
        return (byte) (state&temp);
    }
    static byte toggleBitmask(byte state ,byte... masks){
        return state;
    }
    static byte removeBitmask(byte state, byte... masks){
        return state;
    }
    static byte addBitmask(byte state ,byte... masks){
        return state;
    }
}

import java.util.Scanner;

public class PetrAndComboLock {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int arr[] = new int[n];
        int sum = 0;
        for(int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
            sum += arr[i];
        }
        if(sum%2 != 0) {
            System.out.println("NO");
            return;
        }
        if(sum % 360 == 0) {
            System.out.println("YES");
            return;
        }
        boolean dp[][] = new boolean[n+1][sum/2+1];
        for(int i = 0; i <= n; i++) {
            dp[i][0] = true;
        }
        for(int i = 1; i <= sum/2; i++) {
            dp[0][i] = false;
        }
        for(int i = 1; i <= n; i++) {
            for(int j = 1; j <= sum/2; j++) {
                dp[i][j] = dp[i-1][j];
                if(j >= arr[i-1]) {
                    dp[i][j] = dp[i][j] || dp[i-1][j-arr[i-1]];
                }
            }
        }
        System.out.println(dp[n][sum/2] ? "YES" : "NO");
    }
}

import java.util.Scanner;

public class PetrCombinationLock {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextLong();
        }
        if (fn(arr, 0, true, 0) || fn(arr, 0, false, 0)) System.out.println("YES");
        else System.out.println("NO");
    }

    private static boolean fn(long[] arr, int i, boolean plus, long curr) {
        if (i >= arr.length) {
            if (curr == 0) return true;
            else return false;
        }
        if (plus) curr += arr[i];
        else curr -= arr[i];
        return fn(arr, i + 1, true, curr) || fn(arr, i + 1, false, curr);
    }
}

import java.util.*;

public class Main {

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

	}

}

import java.util.*;
public class rota{
	static int flag=0;
	public static void main(String s[]){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Integer> al = new ArrayList<>();
		for(int i=0;i<n;i++)
			al.add(sc.nextInt());

		check(al, 0, al.size(), 0);
		if(flag==1)
			System.out.println("YES");
		else System.out.println("NO");

	}
	public static void check(ArrayList<Integer> al , int count, int size, int sum){

		if(count == size ){
			if(sum==0 || sum==360){
			flag=1;
			return ;
			}
		}

		if(count >= size){
			if(sum!=0 || sum!=360)
			return ;
		}

		check(al, count+1, size, sum+al.get(count));
		check(al, count+1, size, sum-al.get(count));
		return;
	}
}

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class main

{

    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] arr = new int[n];
        boolean inf  = false;
        for (int i = 0; i < n ; i++) {
            arr[i] = s.nextInt();
        }

        for (int mask = 0; mask < (1 << n) ; mask++) {
            int res = 0;
            for (int j = 0; j < n; j++) {
                if(1 == (1 << mask)){
                    res +=arr[j];
                }
                else {
                    res -=arr[j];
                }

            }
            if(res%360 == 0){
                inf = true;
            }

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

    }

}

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

public class main{

    static boolean ans = false;
    public static void main(String[] args){
        Scanner s= new Scanner(System.in);
        int n  =s.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i]=s.nextInt();
        }

       recursion(arr[0],0,n-1,0,arr);
        recursion(-arr[0],0,n-1,0,arr);
        if(ans){
            System.out.println("YES");
        }
        else{
                        System.out.println("NO");

        }
    }

    public static void recursion( int deg,int i,int f ,int val ,int[] arr){

        if(i==f){
            if(deg+val==360 || deg+val==0){
                ans = true;
            }
            return;
        }

        recursion(arr[i+1],i+1,f,val+deg,arr);
        recursion(-arr[i+1],i+1,f,val+deg,arr);
        return;
    }
}

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

public class Main {

	public static void solve(InputReader in ) {
		int n = in.readInt();
		int a[] = new int[n];
		for(int i = 0; i<n; i++)
			a[i] = in.readInt();

		for(int i = 0; i<(1<<n); i++) {
			int x = 0;
			for(int j = 0; j<n; j++) {
				if((1 & (i << j)) == 1)
					x += a[j];
				else
					x -= a[j];
			}
			if(x % 360 == 0) {
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		int t = 1;
		while (t-- > 0)
			solve(in);
	}
}

class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	 public InputReader(InputStream stream) {
		this.stream = stream;
	}

     public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

     public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

     public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

     public long readLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9') {
				throw new InputMismatchException();
			}
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

     public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

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

     public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

/*
   @author :: Abhimanyu Chauhan
*/

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

public class TaskA implements Runnable{

    long ar[];
    public void solve(){
        int n = scan.nextInt();
        ar = new long[n];
        long s =0L;
        for(int i=0;i<n;i++){
            ar[i] = scan.nextLong();
            s+=ar[i];
        }
        if(s%360==0){
            out.print("YES");
        }else
        out.println(fun(s,0,0)?"YES":"NO");
    }

    boolean fun(long s,long z,int i){
        if(s==z) return true;
        if(i>=ar.length) return false;
        return fun(s-ar[i],z+ar[i],i+1)||fun(s,z,i+1);
    }

    InputReader scan;
    PrintWriter out;

    @Override
    public void run(){
        scan = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null,new TaskA(),"Main",1<<26).start();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}

import java.util.*;
import java.util.stream.*;

public class c1097B
{
	static boolean set(int a[],int i,int tot)
	{
		if(tot<0)
		{
			return false;
		}
		if(tot==0)
		{
			return true;
		}
		else if(i<0)
		{
			return false;
		}
		else
		{
			return set(a,i-1,tot)||set(a,i-1,tot-a[i]);
		}
	}
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=Integer.parseInt(sc.nextLine());
		int num[]=new int[a];
		for(int i=0;i<a;i++)
		{
			num[i]=Integer.parseInt(sc.nextLine());
		}
		int sum=IntStream.of(num).sum()/2;
		//System.out.println(sum);
		if(sum%2!=0)
		{
			System.out.println("NO");
		}
		else
		{
			if(set(num,num.length-1,sum))
			{
				System.out.println("YES");
			}
			else
			{
				System.out.println("YES");
			}
		}
	}
}

import java.util.*;

public class square{

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
     int n=sc.nextInt();
     int[] a=new int[n];
     int sum=0;int start=0;
     for(int i=0;i<n;i++){a[i]=sc.nextInt();
        if(sum+a[i]>360){start=i;sum=a[i];}
    else sum+=a[i];}
     if(sum==0 || sum==360){
         System.out.println("YES");return;
     }

     if(sum%2!=0){
        System.out.println("NO");return;
     }
     int target=sum/2;

boolean[][] subset=new boolean[n-start+1][target+1];
for(int i=0;i<=n-start;i++)subset[i][0]=true;
for(int i=1;i<=target;i++)subset[0][i]=false;
for(int i=1;i<=n-start;i++)
{
    for(int j=1;j<=target;j++)
    {subset[i][j]=subset[i-1][j];
    if(a[start+i-1]<=j)subset[i][j]|=subset[i][j-a[start+i-1]];
}
    }
    if(subset[n-start][target]==true)System.out.println("YES");
    else System.out.println("NO");
}
}

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), a[] = new int[n+1];

        for(int i = 1; i<=n; i++){
            a[i] = in.nextInt()+a[i-1];
        }

        for(int i = 1; i<=n; i++){
            //a[i] - текущая сумма
            if(a[i]%360==(a[n]-a[i])%360){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }

}

import java.io.*;
import java.util.*;
public class Try {
static int n;
static boolean o=false;
static int[]a;
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		PrintWriter out =new PrintWriter (System.out);
		n=sc.nextInt();
		a=new int [n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
	    T(0,0);
	    if(o)
	    	out.println("YES");
	    else
	    	out.println("NO");
        out.flush();
	}
	static void T(int i,int s) {
		if(i==n) {
		   if(s==0||s==360 || s==-360)
			o=true;
		//	System.out.println(s);
			return;
		}
		 T(i+1,s+(-1*a[i]));
		 T(i+1,s+a[i]);
	}
	static	class Scanner{
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}

import java.io.*;
public class Combination_Lock {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		int sum = 0;
		for (int i = 0;i<n;i++)
		{
			arr[i] = Integer.parseInt(br.readLine());
			sum += arr[i];
		}
		if (sum==360)
		{
			System.out.println("YES");
		}
		else if(sum%2!=0)
		{
			System.out.println("NO");
		}
		else
		{
			sum = sum/2;
			boolean[][] dp = new boolean[n][sum+1];
			for (int i=0;i<dp.length;i++)
			{
				for (int j=0;j<dp[0].length;j++)
				{
					if (j==0)
						dp[i][j] = true;
					else if(i==0)
						dp[0][j] = arr[0]==j;
					else if (j<arr[i])
						dp[i][j] = dp[i-1][j];
					else
						dp[i][j] = dp[i-1][j]||dp[i-1][j-arr[i]];
				}
			}
			System.out.println(dp[n-1][sum]?"YES":"NO");
		}

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
 * @author Hatim
 */
public class Main {

	public static void main(String[] args) {
		Solver Task = new Solver();
		Task.solve();
	}

}

class Solver {

	public void solve() {
		FastReader cd = new FastReader();
		PrintWriter out = new PrintWriter(System.out, true);
		int[] rotationsa = new int[cd.nextInt()];
		for (int i = 0; i < rotationsa.length; i++) {
			rotationsa[i] = cd.nextInt();
		}
		Arrays.sort(rotationsa);
		int now = 0;
		for (int i = rotationsa.length - 1; i >= 0; i--) {
			int add = (now + rotationsa[i]) % 360;
			int sub = Math.abs((now - rotationsa[i])) % 360;
			if ((i + 1) % 2 == 0 && sub == 0) {
				now = add;
			} else if (now == 0) {
				now = add;
			} else {
				now = (360 - add) % 360 < sub ? add : sub;
			}
		}
		out.println(now == 0 ? "YES" : "NO");
		cd.close();
		out.close();
	}

	class FastReader {
		private BufferedReader in;
		private StringTokenizer tokenizer;

		public FastReader() {
			in = new BufferedReader(new InputStreamReader(System.in), 233333);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(in.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

		public void close() {
			try {
				in.close();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
	}
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), p[] = new int[n], a[] = new int[n+1];

        for(int i = 0; i<n; i++) p[i] = in.nextInt();
        Arrays.sort(p);

        for(int i = 1; i<=n; i++){
            a[i] = p[i-1]+a[i-1];
        }

        for(int i = 1; i<=n; i++){

            if(a[i]%360==(a[n]-a[i])%360){
                System.out.println("YES");
                return;
            }

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

}

import java.util.*;

public class Program {
	public static void main(String []args) {
	Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		List<Integer> lst = new ArrayList<Integer>();
		while(t>0) {
			lst.add(sc.nextInt());
			t--;
		}

		int sum = lst.get(0);
		int sum1 = lst.get(0);
		int sum2 = lst.get(0);
		int sum3 = lst.get(0);
		boolean flag = true;
		List<Integer> m = new ArrayList<Integer>();
		m.add(lst.get(0));
		for(int i=1;i<lst.size();i++) {
			int k = lst.get(i);
			 sum+=k;
			 sum1-=k;
			 if(flag) {
				 flag = false;
				 sum2+=k;
			 } else {
				 flag = true;
				 sum2-=k;
			 }
			 List<Integer> newLst = new ArrayList<Integer>();
			 for(int j=0;j<m.size();j++){
			     int a = m.get(j);
			     newLst.add(a+k);
			     newLst.add(a-k);
			 }
			 m.addAll(newLst);
		}

		for(int i=0;i<m.size();i++){
		    	//System.out.print(m.get(i)+", ");
		    if(m.get(i)==0 || m.get(i)==360){
		        System.out.println("YES");
		        return;
		    }
		}

		if(sum == 0 || sum == 360 || sum1 == 0 || sum1 == 360 || sum2 == 0 || sum2 == 360 || sum3 ==0 || sum3 == 360) {
			System.out.print("YES");
		} else {
			System.out.print("NO");
		}
	}
}

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

public class OmkarandCircle {
    public static void main(String[] args) {
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();
        long[] arr = new long[n * 2];

        for (int i = 0; i < n; i++)
            arr[i] = arr[n + i] = in.nextInt();

        for (int i = 2; i < n * 2; i++)
            arr[i] += arr[i - 2];

        long ans = 0;

        for (int i = 0; i < n; i++)
            ans = Math.max(ans, arr[n + i - 1] - (i >= 2 ? arr[i - 2] : 0));

        out.println(ans);
        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        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());
        }
    }
}

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		sc.nextLine();
		int[] numbers = new int[t];
		boolean flag = false;
		int i = 0;
		while(i < t) {
			numbers[i] = sc.nextInt();
			i++;
		}
		for(int mask = 0; mask < (1 << t); mask++) {
			int rotation1 = 0, rotation2 = 0;
			for(i = 0; i < t; i++) {
				int a = mask & (1 << i);
				if(a != 0) {
					rotation1 += numbers[i];
				}
				else {
					rotation2 += numbers[i];
				}
			}
			//System.out.println("rotation1 " + rotation1);
			//System.out.println("rotation2 " + rotation2);
			if(rotation1 == rotation2 || rotation1 == 360) {
				flag = true;
				System.out.println("YES");
				break;
			}

		}
		if(flag == false) {
			System.out.println("NO");
		}

		sc.close();
	}
}

import java.util.*;
public class PetrAndACombinationLock {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=new int[n];
		ArrayList<Integer> foo=new ArrayList<>();

		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		foo.add(arr[0]+arr[1]);
		foo.add(arr[0]-arr[1]);
		int k=2,r=2;
		for(int i=0;i<Math.pow(2, n-2);i++) {
			for(int j=0;j<r;j++) {
				System.out.println(k);
				foo.add(foo.get(0)+arr[k]);
				foo.add(foo.get(0)-arr[k]);
				foo.remove(0);
			}
			r=r*2;
			k++;
			if(k==n) {
				break;
			}
		}
		//System.out.println(foo.size()+"bhai");
		//for(int i=0;i<foo.size();i++) {
			//System.out.println(foo.get(i));
		//}
		if(foo.contains(0) || foo.contains(360)) {
			//System.out.println("////");
			//System.out.println(foo.indexOf(0));
			//System.out.println(foo.indexOf(360));
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.util.*;
public class main{
       public static Integer getInt(String s){
           	return Integer.parseInt(s);
           }
           public static int max(int a,int b){return Math.max(a,b);}

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

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          int n =  getInt(br.readLine());

          Integer[] arr = new Integer[n];
          for(int i=0;i<n;i++){
          	arr[i]=getInt(br.readLine());
          }

          Arrays.sort(arr);
            int[] frwrdSum = new int[n];
            frwrdSum[0]=arr[0];
            int[] bckwrdSum = new int[n];
            bckwrdSum[n-1]=arr[n-1];
            for(int j=1;j<n;j++){
            	frwrdSum[j]=frwrdSum[j-1]+arr[j];
            	bckwrdSum[n-j-1]=bckwrdSum[n-j]+arr[n-j-1];
            }
                  String ans="NO";
            for(int k=0;k<n-1;k++){
            	if(frwrdSum[k]==bckwrdSum[k+1]){
            		ans= "YES";
            		break;
            	}
            }
            if(ans.equals("NO") && frwrdSum[n-1]==360)
            	ans="YES";

            System.out.println(ans);

    }
}

import java.util.*;
public class CL
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int m=sc.nextInt();
int a[]=new int[m];
for(int i=0;i<m;i++)
{a[i]=sc.nextInt();}
Arrays.sort(a);
int s=0,s1=0;
for(int i=0;i<m;i++)
s=s+a[i];
for(int i=0;i<m-1;i++)
s1=s1+a[i];
int z=a[m-1]-s1;
if(s%360==0 || z==0)
System.out.print("YES");
else
System.out.print("NO");
}
}

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

public class hacker
{

    // YO fUCK PUSSY MAN
    // Believe yourself you gonna get it
    // Oh!love, oh mine ,gonna fuck you
    public static boolean[] sieve(long n)
    {
        boolean[] prime = new boolean[(int)n+1];
        Arrays.fill(prime,true);
        prime[0] = false;
        prime[1] = false;
        long m = (long)Math.sqrt(n);
        for(int i=2;i<=m;i++)
        {
            if(prime[i])
            {
                for(int k=i*i;k<=n;k+=i)
                {
                    prime[k] = false;
                }
            }
        }
        return prime;
    }

    static long GCD(long a,long b)
    {
        if(a==0 || b==0)
        {
            return 0;
        }
        if(a==b)
        {
            return a;
        }
        if(a>b)
        {
            return GCD(a-b,b);
        }
        return GCD(a,b-a);
    }

    static long CountCoPrimes(long n)
    {
        long res = n;
        for(int i=2;i*i<=n;i++)
        {
            if(n%i==0)
            {
                while(n%i==0)
                {
                    n/=i;
                }
                res-=res/i;
            }
        }
        if(n>1)
        {
            res-=res/n;
        }
        return res;
    }

    //fastest way to find x**n
    static long modularExponentiation(long x,long n,long m)
    {
        long res = 1;
        while(n>0)
        {
            if(n%2==1)
            {
                res = (res*x)%m;
            }
            x =(x*x)%m;
            n/=2;
        }
        return res;
    }

    static long lcm(long a,long b)
    {
        return (a*b)/GCD(a,b);
    }

    static long pow(long a,long b)
    {
        long res = 1;
        while(b>0)
        {
            if((b&1)==1)
            {
                res *= a;
            }

            b >>= 1;
            a *=a;
        }
        return res;
    }

   static long modInverse(long A,long M)
   {
    return modularExponentiation(A,M-2,M);
   }

    static boolean prime(int n)
    {
        for(int i=2;i*i<=n;i++)
        {
            if(i%2==0 ||i%3==0)
            {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) throws IOException
    {
      // = new PrintWriter("explicit.out");
        new hacker().run();

    }

    static int rev(int n)
    {
        int x=0;
        int num = 0;
        while(n>0)
        {
            x = n%10;
            num = num*10+x;
            n/=10;

        }
        return num;
    }

    // static int[][] board;
    static Scanner in = new Scanner(System.in);
    static void run() throws IOException
    {
        int n = ni();
        int[] a= new int[n];
        int sum=0;
        for(int i=0;i<n;i++)
        {
            a[i] = ni();
            sum+=a[i];
        }
        if(sum==360)
        {
            System.out.println("YES");
            return;
        }
        Arrays.sort(a);
        boolean flag =false;
        sum=0;
        for(int i=0;i<n;i++)
        {
            // sum+=a[i];
            if(a[i]==sum)
            {
                sum=0;
                if(i==n-1)
                {
                    flag = true;
                }
            }
            else
            {

                sum+=a[i];
            }
        }

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

    }

    static void printL(long a)
    {
        System.out.println(a);
    }
    static void printS(String s)
    {
        System.out.printf("%s\n",s);
    }

    static void swap(char c,char p)
    {
        char t = c;
        c = p;
        p = t;
    }

    static long max(long n,long m)
    {
        return Math.max(n,m);
    }
    static int min(int n,int m)
    {
        return Math.min(n,m);
    }

    static double nd() throws IOException
    {
        return Double.parseDouble(in.next());
    }
    static int ni() throws IOException
    {
        return Integer.parseInt(in.next());
    }

    static long nl() throws IOException
    {
        return Long.parseLong(in.next());
    }

    static String si() throws IOException
    {
        return in.next();
    }

    static long abs(long n)
    {
        return Math.abs(n);
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

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

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
            {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException {return br.ready();}

    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inclass in = new inclass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrAndACombinationLock {
        int n;

        public void solve(int testNumber, inclass in, PrintWriter out) {
            n = in.nextInt();
            int arr[] = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            if (rec(0, new int[n], 0, arr)) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean rec(int idx, int[] arr, int count, int[] real) {
            if (count == n) {
                if (ok(arr, real)) {
                    return true;
                }
                return false;
            }
            arr[idx] = 1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            arr[idx] = -1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            return false;
        }

        private boolean ok(int[] ones, int[] arr) {
            int sum = 0;
            for (int i = 0; i < ones.length; i++) {
                arr[i] = ones[i] * arr[i];
                sum += arr[i];
            }
            return sum == 0 || sum == 360;
        }

    }

    static class inclass {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private inclass.SpaceCharFilter filter;

        public inclass(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

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

	public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       int n=sc.nextInt();
              int pow=(int)Math.pow(2,n);

       int arr[]=new int[n+1];
       for(int i=0;i<n;i++){
       	arr[i]=sc.nextInt();
       }
       int brr[]=new int[2*pow+3];
       brr[0]=arr[0];
       for(int i=0;i<n;i++){
       	if(i!=n-1){

          brr[2*i+1]=brr[i]+arr[i+1];
          brr[2*i+2]=brr[i]-arr[i+1];
      }else{
 brr[2*i+1]=brr[i]+arr[i];
          brr[2*i+2]=brr[i]-arr[i];      }
       }
              int pow2=(int)Math.pow(2,n-1);

       for(int i=n;i<=pow-2;i++){
       	 brr[2*i+1]=brr[i]+brr[i+1];
          brr[2*i+2]=brr[i]-brr[i+1];
       }

       for(int i=pow-2;i>=pow2;i--){
       	//System.out.println(brr[i]);
       	if(brr[i]%360==0){
       		System.out.println("YES");
       		break;
       	}

       }
       System.out.println("NO");
 // for(int i=0;i<=pow-2;i++){
 // 	System.out.print(brr[i]+" ");
 // }

	}

}

import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
import java.math.*;
public class B {
	public static void main(String[] args)throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int arr[] = new int[n];
		for(int i=0; i<n; ++i) {
			arr[i] = sc.nextInt();
		}
		boolean dp[][] = new boolean[n+1][360];
		dp[0][0] = true;
		for(int i=0; i<n; ++i) {
			for(int j=0; j<360; ++j) {
				if(dp[i][j]) {
					dp[i+1][(j+arr[i])%360] = true;
					dp[i+1][(j-arr[i]+180)%360] = true;
				}
			}
		}
		if(dp[n][0]) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
		out.close();
	}
	static class FastIO {
		InputStream dis;
		byte[] buffer = new byte[1 << 17];
		int pointer = 0;
		public FastIO(String fileName) throws IOException {
			dis = new FileInputStream(fileName);
		}
		public FastIO(InputStream is) throws IOException {
			dis = is;
		}
		int nextInt() throws IOException {
			int ret = 0;

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}

			return (negative) ? -ret : ret;
		}
		long nextLong() throws IOException {
			long ret = 0;

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}
			return (negative) ? -ret : ret;
		}
		byte nextByte() throws IOException {
			if (pointer == buffer.length) {
				dis.read(buffer, 0, buffer.length);
				pointer = 0;
			}
			return buffer[pointer++];
		}
		String next() throws IOException {
			StringBuffer ret = new StringBuffer();

			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			while (b > ' ') {
				ret.appendCodePoint(b);
				b = nextByte();
			}

			return ret.toString();
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.TreeSet;

public class practice_DP {

	static Reader r = new Reader();
	static PrintWriter out = new PrintWriter(System.out);

	private static void solve1() throws IOException {

		int t = r.nextInt();
		StringBuilder res = new StringBuilder();

		while (t-- > 0) {

			int n = r.nextInt();
			int m = r.nextInt();

			int x = r.nextInt();
			int y = r.nextInt();

			char ch[][] = new char[n][m];

			long ans = 0;

			for (int i = 0; i < n; i++) {
				ch[i] = r.next().toCharArray();
				for (int j = 0; j < m; j++) {
					if (ch[i][j] == '.') {
						if (j + 1 < m && ch[i][j + 1] == '.') {
							if (2 * x < y) {
								ans += 2 * x;
							} else {
								ans += y;
							}
							j++;
						} else {
							ans += x;
						}
					}
				}
			}

			res.append(ans).append("\n");

		}

		out.print(res);
		out.close();
	}

	private static void solve2() throws IOException {

		StringBuilder res = new StringBuilder();

		int n = r.nextInt();
		int k = r.nextInt();

		int arr[] = r.nextIntArray(n);

		int cnt = 0;

		for (int i = 1; i < n; i++) {
			if (arr[i] + arr[i - 1] < k) {
				cnt += k - (arr[i] + arr[i - 1]);
				arr[i] += k - (arr[i] + arr[i - 1]);
			}
		}

		res.append(cnt).append("\n");
		for (int i = 0; i < n; i++) {
			res.append(arr[i] + " ");
		}

		out.print(res);
		out.close();

	}

	private static void solve3() throws IOException {

		int n = r.nextInt();

		int ans = 0;
		if ((n & 1) != 0) {
			ans = 0;
		} else {
			ans = (int) Math.pow(2, n / 2);
		}

		out.print(ans);
		out.close();

	}

	private static void solve4() throws IOException {

		int n = r.nextInt();

		int cnt = 0;

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

		int start = 1, sum = 0;
		while (true) {
			sum += start;
			if (sum > n) {
				sum -= start;
				break;
			} else {
				ans.add(start++);
			}
		}

//		System.out.println(sum);
//		System.out.println(ans);

		ans.set(ans.size() - 1, ans.get(ans.size() - 1) + (n - sum));
		out.print(ans.size() + "\n");
		for (int candies : ans) {
			out.print(candies + " ");
		}
		out.close();

	}

	private static void solve5() throws IOException {

		int n = r.nextInt();

		int fibo[] = new int[21];
		fibo[0] = fibo[1] = 1;

		for (int i = 2; i <= 20; i++) {
			fibo[i] = (fibo[i - 1] + fibo[i - 2]);
		}

		out.print(fibo[n]);
		out.close();

	}

	private static int binarySearch6(int ele) {
		int lt = 0, rt = arr.length - 1;
		int ans = 0;
		while (lt <= rt) {
			int mid = (lt + rt) / 2;
			if (arr[mid] > ele) {
				rt = mid - 1;
			} else {
				ans = mid + 1;
				lt = mid + 1;
			}
		}
		return ans;
	}

	private static void solve6() throws IOException {

		StringBuilder res = new StringBuilder();

		int n = r.nextInt();
		arr = r.nextIntArray(n);

		Arrays.sort(arr);

		int q = r.nextInt();
		while (q-- > 0) {
			int ele = r.nextInt();
			res.append(binarySearch6(ele)).append("\n");
		}

		out.print(res);
		out.close();

	}

	private static void solve7() throws IOException {

		String s = r.next();

		int dp1[] = new int[s.length() + 1];
		int dp2[] = new int[s.length() + 1];

		dp1[0] = dp2[0] = 0;
		for (int i = 0; i < s.length(); i++) {
			dp1[i + 1] = dp1[i];
			dp2[i + 1] = dp2[i];
			if (s.charAt(i) == '.') {
				if (i + 1 < s.length() && s.charAt(i + 1) == '.') {
					dp1[i + 1]++;
				}
			} else {
				if (i + 1 < s.length() && s.charAt(i + 1) == '#') {
					dp2[i + 1]++;
				}
			}
		}

//		System.out.println(Arrays.toString(dp1));
//		System.out.println(Arrays.toString(dp2));

		int m = r.nextInt();
		while (m-- > 0) {

			int lt = r.nextInt() - 1;
			int rt = r.nextInt() - 1;

			out.print(dp1[rt] - dp1[lt] + dp2[rt] - dp2[lt] + "\n");

		}
		out.close();

	}

	static class Query {
		int pos, val;

		public Query(int idx, int vali) {
			pos = idx;
			val = vali;
		}
	}

	static int cnt = 0, freq[], arr[];

	private static void add(int idx) {
		if (freq[arr[idx]] == 0) {
			cnt++;
		}
		freq[arr[idx]]++;
	}

	private static void remove(int idx) {
		freq[arr[idx]]--;
		if (freq[arr[idx]] == 0) {
			cnt--;
		}
	}

	private static void solve8() throws IOException {

		int n = r.nextInt();
		int m = r.nextInt();

		arr = new int[n + 1];
		freq = new int[(int) 1e5 + 1];
		Query q[] = new Query[m];

		for (int i = 1; i <= n; i++) {
			arr[i] = r.nextInt();
			add(i);
		}

		// Applying MO's Algorithm

		for (int i = 0; i < m; i++) {
			q[i] = new Query(i, r.nextInt());
		}
		Arrays.sort(q, new Comparator<Query>() {
			@Override
			public int compare(Query o1, Query o2) {
				return o1.val - o2.val;
			}
		});

		int ans[] = new int[m];
		int lt = 1;
		for (int i = 0; i < m; i++) {
			int val = q[i].val;
			while (lt < val) {
				remove(lt++);
			}
			ans[q[i].pos] = cnt;
		}

		for (int i = 0; i < m; i++) {
			out.println(ans[i]);
		}
		out.close();

	}

	private static void solve9() throws IOException {

		int n = r.nextInt();
		int k = r.nextInt();

		int dp[] = r.nextIntArray(n);
		for (int i = 1; i < n; i++) {
			dp[i] += dp[i - 1];
		}

		int min = dp[k - 1], ans = 0;

		for (int i = k; i < n; i++) {
			if (dp[i] - dp[i - k] < min) {
				min = dp[i] - dp[i - k];
				ans = i - k + 1;
			}
		}

		out.print(++ans);
		out.close();

	}

	private static long sum(long n) {
		return ((n * (3 * n + 1)) / 2);
	}

	private static long binarySearch10(long n) {
		long lt = 1, rt = n;
		long ans = 0;
		while (lt <= rt) {
			long mid = (lt + rt) / 2;
			long val = sum(mid);
			if (val <= n) {
				ans = mid;
				lt = mid + 1;
			} else {
				rt = mid - 1;
			}
		}
		return ans;
	}

	private static void solve10() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			long n = r.nextLong();

			long cnt = 0;

			while (n > 1) {
				long tallest = binarySearch10(n);
				cnt++;
				n -= sum(tallest);
			}

			out.println(cnt);

		}
		out.close();

	}

	private static void solve11() throws IOException {

		int a1 = r.nextInt();
		int a2 = r.nextInt();

		int temp = a1;
		a1 = Math.min(a1, a2);
		a2 = Math.max(a2, temp);

		int cnt = 0;
		while (a1 > 0 && a2 > 0) {
			if (a1 <= 1 && a2 <= 1) {
				break;
			}
			if (a1 > 2) {
				cnt++;
				a1 -= 2;
				a2++;
			} else {
				cnt++;
				a1++;
				a2 -= 2;
			}
		}

		out.print(cnt);
		out.close();

	}

	private static int digitSum(int num) {
		int sum = 0;
		while (num > 0) {
			sum += (num % 10);
			num /= 10;
		}
		return sum;
	}

	private static void solve12() throws IOException {

		int k = r.nextInt();

		int num = 18;
		while (k > 0) {
			if (digitSum(++num) == 10) {
				k--;
			}
		}

		out.print(num);
		out.close();

	}

	private static void solve13() throws IOException {

		int n = r.nextInt();

		int h[] = new int[n];
		int w[] = new int[n];
		int hi[] = new int[n];
		int w_cumu = 0;

		for (int i = 0; i < n; i++) {
			w[i] = r.nextInt();
			w_cumu += w[i];
			h[i] = r.nextInt();
			hi[i] = h[i];
		}

		Arrays.sort(hi);

		for (int i = 0; i < n; i++) {
			int ans = (w_cumu - w[i]);
			if (hi[n - 1] == h[i]) {
				ans *= hi[n - 2];
			} else {
				ans *= hi[n - 1];
			}
			out.print(ans + " ");
		}
		out.close();

	}

	private static long maxDigit(long num) {
		long max = -1;
		while (num > 0) {
			long digit = num % 10;
			num /= 10;
			max = Math.max(max, digit);
		}
		return max;
	}

	private static void solve14() throws IOException {

		long n = r.nextLong();

		long cnt = 0;
		while (n > 0) {
			n -= maxDigit(n);
			cnt++;
		}

		out.print(cnt);
		out.close();

	}

	private static void solve15() throws IOException {

		int n = r.nextInt();
		int arr[] = r.nextIntArray(n);

		int dp[] = new int[n + 1];
		int tot = 0;
		for (int i = 0; i < n; i++) {
			if (arr[i] == 0) {
				dp[i + 1] = 1;
			} else {
				tot++;
				dp[i + 1] = -1;
			}
		}

		for (int i = 1; i <= n; i++) {
			dp[i] += dp[i - 1];
		}

		int max = Integer.MIN_VALUE;
		for (int i = n; i >= 1; i--) {
			for (int j = 1; j <= i; j++) {
				if (tot + dp[i] - dp[j - 1] > max) {
					max = tot + dp[i] - dp[j - 1];
				}
			}
		}

		out.print(max);
		out.close();

	}

	private static void solve16() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			int n = r.nextInt();
			int arr[] = r.nextIntArray(n);

			ArrayList<Integer> sub_seq = new ArrayList<Integer>();
			int i = 0;
			while (i < n) {
				int max = Integer.MIN_VALUE;
				while (i < n && arr[i] < 0) {
					max = Math.max(max, arr[i++]);
				}
				if (max != Integer.MIN_VALUE)
					sub_seq.add(max);
				max = Integer.MIN_VALUE;
				while (i < n && arr[i] > 0) {
					max = Math.max(max, arr[i++]);
				}
				if (max != Integer.MIN_VALUE)
					sub_seq.add(max);
			}
			long sum = 0;
			for (int ele : sub_seq) {
				sum += ele;
			}

			out.print(sum + "\n");

		}
		out.close();

	}

	private static void solve17() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			int n = r.nextInt();
			int arr[] = r.nextIntArray(n);

			Arrays.sort(arr);

			int max = Integer.MIN_VALUE, cnt = 0, ans = 0;
			for (int i = 0; i < n; i++) {
				max = Math.max(max, arr[i]);
				cnt++;
				if (max == cnt) {
					max = Integer.MIN_VALUE;
					cnt = 0;
					ans++;
				}
			}

			out.print(ans + "\n");

		}

		out.close();

	}

	private static void solve18() throws IOException {

		int t = r.nextInt();

		while (t-- > 0) {

			char str[] = r.next().toCharArray();

			TreeSet<Integer> one = new TreeSet<>();
			TreeSet<Integer> two = new TreeSet<>();
			TreeSet<Integer> three = new TreeSet<>();

			for (int i = 0; i < str.length; i++) {
				if (str[i] == '1') {
					one.add(i);
				} else if (str[i] == '2') {
					two.add(i);
				} else {
					three.add(i);
				}
			}

			int min = Integer.MAX_VALUE;

			for (int idx1 : one) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (two.higher(idx1) != null) {
					int idx2 = two.higher(idx1);
					if (three.higher(idx2) != null) {
						int idx3 = three.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (three.higher(idx1) != null) {
					int idx2 = three.higher(idx1);
					if (two.higher(idx2) != null) {
						int idx3 = two.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			for (int idx1 : two) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (one.higher(idx1) != null) {
					int idx2 = one.higher(idx1);
					if (three.higher(idx2) != null) {
						int idx3 = three.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (three.higher(idx1) != null) {
					int idx2 = three.higher(idx1);
					if (one.higher(idx2) != null) {
						int idx3 = one.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			for (int idx1 : three) {
				int len1 = Integer.MAX_VALUE, len2 = Integer.MAX_VALUE;
				if (two.higher(idx1) != null) {
					int idx2 = two.higher(idx1);
					if (one.higher(idx2) != null) {
						int idx3 = one.higher(idx2);
						len1 = Math.min(len1, idx3 - idx1 + 1);
					}
				}
				if (one.higher(idx1) != null) {
					int idx2 = one.higher(idx1);
					if (two.higher(idx2) != null) {
						int idx3 = two.higher(idx2);
						len2 = Math.min(len2, idx3 - idx1 + 1);
					}
				}
				min = Math.min(Math.min(len1, len2), min);
			}

			if (min == Integer.MAX_VALUE) {
				min = 0;
			}

			out.println(min);

		}

		out.close();

	}

	private static void solve19() throws IOException {

		int n = r.nextInt();

		long arr[] = new long[n + 1];
		long sorted[] = new long[n + 1];

		for (int i = 1; i <= n; i++) {
			arr[i] = r.nextLong();
			sorted[i] = arr[i];
		}

		Arrays.sort(sorted);

		for (int i = 1; i <= n; i++) {
			arr[i] += arr[i - 1];
			sorted[i] += sorted[i - 1];
		}

		int m = r.nextInt();
		StringBuilder ans = new StringBuilder();

		while (m-- > 0) {

			int type = r.nextInt();
			int lt = r.nextInt();
			int rt = r.nextInt();

			long an = 0;
			if (type == 1) {
				an = arr[rt] - arr[lt - 1];
			} else {
				an = sorted[rt] - sorted[lt - 1];
			}
			ans.append(an).append("\n");

		}

		out.print(ans);
		out.close();

	}

	private static void solve20() throws IOException {

		int n = r.nextInt();
		long arr[] = r.nextLongArray(n);

		long dp[][] = new long[n][1 << n];
		for (int i = 0; i < n; i++) {
			Arrays.fill(dp[i], -1);
		}

		dp[0][0] = arr[0];
		dp[0][1] = -arr[0];

		for (int i = 1; i < n; i++) {
			int idx = 0;
			for (int j = 0; j < dp[i - 1].length; j++) {
				if (dp[i - 1][j] != -1) {
					dp[i][idx++] = dp[i - 1][j] + arr[i];
					dp[i][idx++] = dp[i - 1][j] - arr[i];
				} else {
					idx++;
				}
			}
		}

//		System.out.println(Arrays.toString(dp[n - 1]));

		boolean flag = false;
		for (int i = 0; i < dp[0].length; i++) {
			if (Math.abs(dp[n - 1][i]) == 0 || Math.abs(dp[n - 1][i]) == 360) {
				flag = true;
				break;
			}
		}

		out.print(flag ? "YES" : "NO");
		out.close();

	}

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

//		solve1();

//		solve2();

//		solve3();

//		solve4();

//		solve5();

//		solve6();

//		solve7();

//		solve8();

//		solve9();

//		solve10();

//		solve11();

//		solve12();

//		solve13();

//		solve14();

//		solve15();

//		solve16();

//		solve17();

//		solve18();

//		solve19();

		solve20();

	}

	static class Reader {

		final private int BUFFER_SIZE = 1 << 12;
		boolean consume = false;
		private byte[] buffer;
		private int bufferPointer, bytesRead;
		private boolean reachedEnd = false;

		public Reader() {
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = 0;
			bytesRead = 0;
		}

		public boolean hasNext() {
			return !reachedEnd;
		}

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

		private void consumeSpaces() throws IOException {
			while (read() <= ' ' && reachedEnd == false)
				;
			bufferPointer--;
		}

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

		public String next() throws IOException {
			StringBuilder sb = new StringBuilder();
			consumeSpaces();
			byte c = read();
			do {
				sb.append((char) c);
			} while ((c = read()) > ' ');
			if (consume) {
				consumeSpaces();
			}
			;
			if (sb.length() == 0) {
				return null;
			}
			return sb.toString();
		}

		public String nextLine() throws IOException {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str = br.readLine();
			return str;
		}

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

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

		public double nextDouble() throws IOException {
			consumeSpaces();
			double ret = 0;
			double div = 1;
			byte 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 (consume) {
				consumeSpaces();
			}
			if (neg) {
				return -ret;
			}
			return ret;
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextLong();
			}
			return a;
		}

		public int[][] nextIntMatrix(int n, int m) throws IOException {
			int[][] grid = new int[n][m];
			for (int i = 0; i < n; i++) {
				grid[i] = nextIntArray(m);
			}
			return grid;
		}

		public char[][] nextCharacterMatrix(int n) throws IOException {
			char[][] a = new char[n][];
			for (int i = 0; i < n; i++) {
				a[i] = next().toCharArray();
			}
			return a;
		}

		public void close() throws IOException {
			if (System.in == null) {
				return;
			} else {
				System.in.close();
			}
		}
	}

}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static class Task {

		int NN = 1000006;
		int MOD = 998244353;
		int INF = 2000000000;
		long INFINITY = 1000000000000000000L;

		int [] a;
		int [][] dp = new int[10000][20];

		public void solve(InputReader in, PrintWriter out) {
			int n = in.nextInt();
			a = new int[n];
			int sum = 0;
			for(int i=0;i<n;++i) {
				a[i] = in.nextInt();
				sum += a[i];
			}
			if(sum == 360) {
				out.println("YES");
				return;
			}
			sum /= 2;
			for(int i=0;i<=sum;++i) {
				for(int j=0;j<=n;++j)
					dp[i][j] = -1;
			}
			out.println(rec(sum, n)?"YES":"NO");
		}

		boolean rec(int sum, int n) {
			if(dp[sum][n] != -1)
				return dp[sum][n] == 1;
			if(n == 0) {
				dp[sum][n] = (sum == 0?1:0);
				return dp[sum][n] == 1;
			}
			if(sum == 0) {
				dp[sum][n] = 1;
				return true;
			}
			boolean ret = rec(sum, n - 1);
			if(sum >= a[n - 1])
				ret = ret || rec(sum - a[n - 1], n - 1);
			if(ret)
				dp[sum][n] = 1;
			else
				dp[sum][n] = 0;
			return ret;
		}

	}

	static void prepareIO(boolean isFileIO) {
		Task solver = new Task();
		// Standard IO
		if(!isFileIO) {
			InputStream inputStream = System.in;
	        OutputStream outputStream = System.out;
	        InputReader in = new InputReader(inputStream);
	        PrintWriter out = new PrintWriter(outputStream);
	        solver.solve(in, out);
	        out.close();
		}
        // File IO
		else {
			String IPfilePath = System.getProperty("user.home") + "/Downloads/ip.in";
	        String OPfilePath = System.getProperty("user.home") + "/Downloads/op.out";
	        InputReader fin = new InputReader(IPfilePath);
	        PrintWriter fout = null;
	        try {
				fout = new PrintWriter(new File(OPfilePath));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
	        solver.solve(fin, fout);
	        fout.close();
		}
	}

	public static void main(String[] args) {
        prepareIO(false);
	}

	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public InputReader(String filePath) {
        	File file = new File(filePath);
            try {
				reader = new BufferedReader(new FileReader(file));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            tokenizer = null;
        }

        public String nextLine() {
        	String str = "";
        	try {
				str = reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
        	return str;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    }

}

import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String ag[])
    {
        Scanner sc=new Scanner(System.in);
        int i,j,k;
        int N=sc.nextInt();
        int A[]=new int[N+1];
        for(i=0;i<N;i++)
        A[i]=sc.nextInt();
        int sum=0;
        for(i=0;i<N;i++)
        sum+=A[i];
        int dp[][]=new int[N][sum+1];
        for(i=0;i<N;i++)
        Arrays.fill(dp[i],-1);
        if(find(0,sum,N,A,dp)==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
    public static int find(int id,int sum,int N,int A[],int dp[][])
    {
        if(id==N)
        {
            if(sum%360==0)
            return 1;
            return 0;
        }
        if(dp[id][sum]!=-1)
        return dp[id][sum];
       // System.out.println(id+" "+sum);
        return dp[id][sum]=Math.max(dp[id][sum],Math.max(find(id+1,sum-A[id],N,A,dp),find(id+1,sum,N,A,dp)));
    }
}

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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            Integer a = new Integer(in.next());
            Integer[] num = new Integer[20];
            for (int i = 1; i <= a; ++i) {
                num[i] = new Integer(in.next());
            }
            for (int j = 0; j < (1 << a); ++j) {
                int sum = 0;
                int count = a, j1 = j;
                while (count > 0) {
                    if (j1 % 2 == 1) {
                        sum = sum + num[count];
                    } else {
                        sum = sum - num[count];
                    }
                    if (sum == 360) {
                        sum = 0;
                    }
                    j1 /= 2;
                    count--;
                }
                if (sum == 0) {
                    out.println("YES");
                    return;
                }
            }
            out.println("NO");
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
    }
}

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

public class Ah {

    public static void main(String[] args) throws IOException {
         FastReader in = new FastReader();
        int p=0;
     int  n=in.nextInt();
    int []a = new int[n];
        for (int i = 0; i < n; i++) {

            a[i]=in.nextInt();
                p+=a[i];

        }
         p=p%360;
         if(p==0)
        System.out.println("YES");
         else
         {
             int o=p/2;
             int r=o;
             for (int i = 0; i < n; i++) {
                 if(o-a[i]>=0)
                 {o-=a[i];}
                 else if(r-a[i]>=0)
                 {r-=a[i];}
             }
            if(o==r&&o==0)
            {System.out.println("YES");}
            else
            {System.out.println("NO");}
         }

    }
}

class FastReader {

        BufferedReader br;
        StringTokenizer st;

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

        public String next() throws IOException {
            if (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

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

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

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

        public String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException ex) {
            }
            return s;
        }
    }

import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String ag[])
    {
        Scanner sc=new Scanner(System.in);
        int i,j,k;
        int N=sc.nextInt();
        int A[]=new int[N+1];
        for(i=0;i<N;i++)
        A[i]=sc.nextInt();
        int dp[]=new int[N];
        Arrays.fill(dp,-1);
        if(find(0,0,N,A,dp)==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
    public static int find(int id,int sum,int N,int A[],int dp[])
    {
        if(id==N)
        {
            if(sum%360==0)
            return 1;
            return 0;
        }
        if(dp[id]!=-1)
        return dp[id];

        return dp[id]=Math.max(dp[id],Math.max(find(id+1,sum+A[id],N,A,dp),find(id+1,sum-A[id],N,A,dp)));
    }
}

import java.io.*;
import java.sql.Array;
import java.util.*;

public class Main {
    public static void main(String[] args)  {
        __SolutionBase begin = new __SolutionBase();
        begin.Solve();
    }
}
class __SolutionBase {

    public void Solve() {
        init();
        Solution();
        out.close();
    }
    private void Solution(){
        int n = readInt();

        int[] gr = new int[n];
        int[] sum = new int[n];
        for (int i = 0;i < n;i++) gr[i] = readInt();
        Arrays.sort(gr);
        sum[0] = gr[0];
        if ( n == 1 )
            out.println("NO");

        for (int i = 1;i < n;i++) sum[i] = sum[i-1] % 360 + gr[i];
        if (sum[n - 1] % 360 == 0){
            out.println("YES");
            return;
        }
        /*
        for (int i = n - 2;i >= 0 ;i--) {
            if (sum[i] == (sum[n - 1] - sum[i])) {
                out.println("YES");
                return;
            }
        }
        */
        int find = sum[n - 1]/2;
        int check = 0;
        if (n == 2){
            out.println(gr[0] == gr[1] ? "YES":"NO");
            return;
        }
        if (sum[n - 1] % 2 == 1 && n % 2 == 1){
            out.println("NO");
            return;
        }

        for (int i = 0;i < n;i++){
            check += gr[i];
            for (int j = i + 1; j < n; j++){
                if (check + gr[j] == find){
                    out.println("YES");
                    return;
                }
            }
        }
        out.println("NO");
    }

    /**
     * readLong, readDouble and other are similar
     *
     * @return int type from input
     */
    private int readInt() {
        return Integer.parseInt(readString());
    }

    private long readLong() {
        return Long.parseLong(readString());
    }
    /**
     * Tokens are separated by space or endExclusive of line
     *
     * @return non-empty string token from input (or null if there is no any token)
     */
    private String readString() {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) return null;
            tok = new StringTokenizer(nextLine);
        }

        return tok.nextToken();
    }

    /**
     * @return whole line from input
     */
    private String readLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer(" ");

    /**
     * For local testing I use pair 'input.txt'/'output.txt' in the project root
     */
    private void init() {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (FileNotFoundException e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }
}

//package CodeForces;

import java.util.Scanner;

public class PetrandaCombinationLock {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int arr[]=new int[n];
		int sum=0;
		for(int i=0;i<n;i++)
		{
			arr[i]=s.nextInt();
			sum=sum+arr[i];
		}

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

	}

}

import java.util.*;
import java.io.*;
public class prac
{
       public static void main(String args[])throws Exception
       {

              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              int n;
              n=Integer.parseInt(br.readLine());
              int a[]=new int[n];
              int b[]=new int[n];
              int i,sum1=0,sum2=0;
              for(i=0;i<n;i++)
              {
                   a[i]=Integer.parseInt(br.readLine());

              }
              Arrays.sort(a);
              sum1=a[n-1];
              sum2=a[n-1];
              for(i=n-2;i>=0;i--)
              {
                  if(a[i]>sum1)
                  sum1+=a[i];
                  else
                  sum1-=a[i];
                  sum2+=a[i];
              }
              if(sum1%10==0||sum2%360==0)
              System.out.println("YES");
              else
              System.out.println("NO");
       }
}

import java.util.Scanner;

public class CombinationLock {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in) ;

		int n = sc.nextInt() ;

		int arr[] = new int[n] ;

		for(int i = 0; i < n ; i++)
		{
			arr[i] = sc.nextInt() ;
		}

//		System.out.println(isPossible(arr, 0, 0));
		if(isPossible(arr, 0, 0))
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}

	}

	public static boolean isPossible(int arr[],int vidx , int sum)
	{

		if((sum == 0||sum==360) && vidx != 0&& vidx == arr.length)
		{
			return true;
		}
		if(vidx == arr.length)
		{
			return false ;
		}

		boolean recRes = isPossible(arr, vidx + 1, sum + arr[vidx]) ;
		if(recRes)
		{
			return true;
		}

		recRes = isPossible(arr, vidx + 1, sum - arr[vidx]) ;

		if(recRes)
		{
			return true;
		}
		return recRes ;

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class testMemory {
	static boolean f=false;
	static Scanner sc =new Scanner(System.in);
	public static boolean check(int x,int y) {
		    if(y==(x+1)||y==(x-1))
		        return true;
		    else
		        return false;
	}

	public static void run() {
		int k=sc.nextInt();
		int key[]=new int[k];
		for(int i=0;i<k;i++)
			key[i]=sc.nextInt();
		//Arrays.sort(key);
		int l=sc.nextInt();
		int lock[]=new int[l];
		for(int i=0;i<l;i++)
			lock[i]=sc.nextInt();
		//Arrays.sort(lock);

	//	int j=0;
		for(int i=0;i<k;i++) {
           for(int j=0;j<l;j++) {
        	   if(check(key[i],lock[j]))
        		   System.out.println(key[i]);
        	   return;
           }
		}
	}

	public static void EhabTheXorcist() {
		long u=sc.nextLong();
		long v=sc.nextLong();
		if(v<u) {
			System.out.println(-1);
			return;
		}
		if(u==0&&v==0) {
			System.out.println(0);
			return;
		}

		if(u==v) {
			System.out.println(1);
			System.out.println(u);
			return;
		}
		if((u&1)!=0&&(v&1)==0) {
			System.out.println(-1);
			return;
		}
		if((u&1)==0&&(v&1)!=0) {
			System.out.println(-1);
			return;
		}
		long x=(v>>1)-(u>>1);
		if(u==0) {
			System.out.println(2);
			System.out.println(x+" "+x);
			return;
		}
		long l=u;
		long r=v;
		while(l < r) {
			//System.out.println(l+"    "+r);
			long m = (l>>1)+(r>>1);
			long t=m^u;
			long s=t+m;
			//System.out.println("m "+m+" t "+t);
			if(s==v) {
				System.out.println(2);
				System.out.println(m+" "+t);
				return;
			}
			else if(s>v) {
				r=m-1;
			}
			else {
				l=m+1;
			}
		}
		if(l==r) {
			if((l^r)==u&&l+r==v) {
				System.out.println(2);
				System.out.println(l+" "+r);
				return;
			}
		}
		System.out.println(3);
		System.out.println(u+" "+x+" "+x);

	}
	public static String input() {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			return br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public static int inputInt() {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		int x=0;
		try {
			st = new StringTokenizer(br.readLine());
			 x= Integer.parseInt(st.nextToken());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return x;
	}
	public static void Hotelier() {
		 int n=Integer.parseInt(sc.nextLine());
		 StringBuilder s = new StringBuilder();
		 s.append(input());
		 //
		 int []mask=new int[10];
		 for(int i=0;i<s.length();i++) {

			 if(s.charAt(i)=='R') {
				 //System.out.println("R");
				 for(int j=mask.length-1;j>=0;j--) {
					 if(mask[j]==0) {
						 mask[j]=1;
						 break;
					 }
				 }

			 }
			 //8
			 //LLRL1RL1
			 else if(s.charAt(i)=='L') {
				 //System.out.println("L");
				 for(int j=0;j<mask.length;j++) {
					 if(mask[j]==0) {
						 mask[j]=1;
						 break;
					 }
				 }
			 }
			 else {
				 System.out.println((char)s.charAt(i)+" "+i);
				 //mask[((char)s.charAt(i))-48]=0;

			 }
			 //System.out.println(Arrays.toString(mask));

		 }
		 for(int i=0;i<10;i++) {
			 System.out.print(mask[i]);
		 }
		 System.out.println();
	}
	public static void  GameWithString() {
		String s=input();
		Stack <Character>s1=new Stack<Character>();
		Stack <Character>s2=new Stack<Character>();
		for(int i=0;i<s.length();i++) {
			s1.push(s.charAt(i));
		}
		boolean f=true;
		while(!s1.isEmpty()) {
			if(!s2.isEmpty()) {
				if(s1.peek()==s2.peek()) {
					s1.pop();
					s2.pop();
					f=!f;
					continue;
				}
			}
		//	else {
				s2.push(s1.pop());

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

	}
	public static void SerejaAndSuffixes() {
		int n=sc.nextInt();
		int m=sc.nextInt();

		int a[]=new int[n];
		int max=0;
		for(int i=0;i<a.length;i++) {
			a[i]=sc.nextInt();
			if(a[i]>max)max=a[i];
			//System.out.println("aaa");

		}
		boolean []mask=new boolean[max+1];
		int []temp=new int[n];
		temp[n-1]=1;
		mask[a[n-1]]=true;
		for(int i=n-2;i>=0;i--) {
			int x=temp[i+1];
			if(!mask[a[i]]) {
				mask[a[i]]=true;
				x++;
			}
			temp[i]=x;
		}
		for(int i=0;i<m;i++) {
			int y=sc.nextInt();
			System.out.println(temp[y-1]);
		}

	}
	public static void HitTheLottery() {
		int n=sc.nextInt();
		int count=0;
		int [] m= {100,20,10,5,1};
		for(int i=0;i<5;i++) {
			if(n>=m[i]) {
				int x=n/m[i];
				count+=x;
				n=n-x*m[i];
			}
		}
		System.out.println(count);

	}
	public static int lg(long x) {
		return (int)(Math.log10(x)/Math.log10(2));
	}
	public static void ANDORAndSquareSum() {
		int n=sc.nextInt();
		long m[]=new long[n];
		int a[]=new int[20];
		int maxb=0;
		for(int i=0;i<n;i++) {
			m[i]=sc.nextInt();
			long t=m[i];
			int bit=0;
			while(t>0) {
				if((t&1)!=0) {
					a[bit]++;
					if(a[bit]>maxb)
						maxb=a[bit];
				}
				bit++;
				t>>=1;
			}
		}
		long num[]=new long[maxb];
		for(int i=0;i<a.length;i++) {
			int j=0;
			while(a[i]>0) {
				num[j]=num[j]|(1<<i);
				j++;
				a[i]--;
			}
		}
		long sum=0;
		for(int i=0;i<num.length;i++) {
			sum+=(num[i]*num[i]);
		}
		System.out.println(sum);

	}
	public static void PolycarpTraining() {
		int n=sc.nextInt();
		//int a[]=new int[n];
		//TreeSet <Integer>t=new TreeSet<Integer>();
		LinkedList <Integer>l=new LinkedList<Integer>();
		for(int i=0;i<n;i++) {
			//a[i]=sc.nextInt();
			l.add(sc.nextInt());
		}

		Collections.sort(l);
		//System.out.println(l);
		//Arrays.sort(a);
		int days=1;
		for(int i=0;i<n;i++) {
			if(l.remove()>=days) {
				days++;
			}

		}
		System.out.println(days-1);
	}
	public static void PolycarpTraining2() {
		int n=sc.nextInt();
		int a[]=new int[n];
		//TreeSet <Integer>t=new TreeSet<Integer>();
		//LinkedList <Integer>l=new LinkedList<Integer>();
		for(int i=0;i<n;i++) {
			a[i]=sc.nextInt();
			//l.add(sc.nextInt());
		}

		//Collections.sort(l);
		//System.out.println(l);
		Arrays.sort(a);
		int days=1;
		for(int i=0;i<n;i++) {
			if(a[i]>=days) {
				days++;
			}

		}
		System.out.println(days-1);
	}
//	private static int daysAtindex(int currentDay,int currentContest) {
//		double t=(Math.sqrt(1+((currentDay+currentContest)*8))-1)/2;
//		return (int)t;
//	}

	public static void RequiredRemainder() {
		int t=sc.nextInt();
		for(int o=0;o<t;o++) {
			int x=sc.nextInt();
			int y=sc.nextInt();
			int n=sc.nextInt();
			int c1=(n-y)%x;// correct
			System.out.println(n-c1);
			int c=((n-y)/x)*x+y;
			System.out.println(c);

		}
	}
    static int binarySearch( int arr[],int x,int l,int r)
    {

        while (l <= r) {
            int m = l + (r - l) / 2;

            // Check if x is present at mid
            if (arr[m] == x)
                return m;

            // If x greater, ignore left half
            if (arr[m] < x)
                l = m + 1;

            // If x is smaller, ignore right half
            else
                r = m - 1;
        }

        // if we reach here, then element was
        // not present
        return -1;
    }

    public static void MultiplyBy2DivideBy6() {
    	int t=sc.nextInt();
    	for(int i=0;i<t;i++) {
    		int n=sc.nextInt();
    		int c2=0;
    		int c3=0;
    		while(n%3==0) {
    			c3++;
    			n/=3;
    		}
    		while(n%2==0) {
    			c2++;
    			n>>=1;
    		}
    		if(n==1) {
    			if(c3>=c2) {
    				//c3-c2;
    				System.out.println(c3+(c3-c2));
    			}
    			else
    				System.out.println(-1);

    		}
    		else
    			System.out.println(-1);
    	}
    }
    public static void GameWithArray() {
    	int n=sc.nextInt();
    	int s=sc.nextInt();
		 PrintWriter out = new PrintWriter(System.out);
    	if((2*n)>=(s+1)) {
    	    out.println("NO");  // it has the same functions as System.out (print(), println(), printf())
            out.flush();

    	}
    	else {
             out.println("YES");  // it has the same functions as System.out (print(), println(), printf())
             out.flush();
    		//System.out.println("YES");
    		for(int i=0;i<n-1;i++) {
                out.print(1+" ");  // it has the same functions as System.out (print(), println(), printf())
                //out.flush();
    			s--;
    		}
            out.print(s);  // it has the same functions as System.out (print(), println(), printf())
            out.flush();

    		//System.out.print(s);
    		System.out.println();
    		System.out.println(s-1);
    	}
    }
    public static void GameWithArray2() {
    	int n=sc.nextInt();
    	int s=sc.nextInt();
		PrintWriter out = new PrintWriter(System.out);
		int d=s/n;
		int mod=s%n;
		if(d<=1) {
    	    out.println("NO");  // it has the same functions as System.out (print(), println(), printf())
            out.flush();
		}
		else {
			 out.println("YES");  // it has the same functions as System.out (print(), println(), printf())
             out.flush();
    		//System.out.println("YES");
    		for(int i=0;i<n-1;i++) {
                out.print(d+" ");  // it has the same functions as System.out (print(), println(), printf())
                //out.flush();
    			//s--;
    		}
            out.print(d+mod);  // it has the same functions as System.out (print(), println(), printf())
            out.flush();

    		//System.out.print(s);
    		System.out.println();
    		System.out.println(1);
		}

    }
    public static void MagicalSticks() {
    	int t=sc.nextInt();
    	for(int i=0;i<t;i++) {
    		int a=sc.nextInt();
    		System.out.println((a*(a+1))/(2*a));
    	}
    }

    public static void  QAQ() {
    	String s=sc.nextLine();
    	String word=s;
    	//StringBuilder word=new StringBuilder();
    	//word.append(s);
    	int count=0;
    	int []a=new int[s.length()];
    	for(int i=0;i<s.length();i++) {
    		if(word.charAt(i)=='Q') {
    			for(int j=i+1;j<s.length();j++) {
    				if(word.charAt(j)=='A') {
    	    			//System.out.println(j);

    					if(a[j]!=0) {
    						count+=a[j]-1;
    					}
    					else {
    						a[j]=1;
    					for(int k=j+1;k<s.length();k++) {
    						if(word.charAt(k)=='Q') {
    						//	System.out.println("a");
    							a[j]++;
    							count++;
    						}
    					}
    					}
    				}
    			}
    		}
    	}
    	System.out.println(count);

    }

    public static void PetrAndACombinationLock() {
    	int n=sc.nextInt();
    	int a[]=new int[n];
    	for(int i=0;i<n;i++) {
    		a[i]=sc.nextInt();
    	}
    	helper(0,a,n,0);
    }
    private static void helper(int i,int a[],int n,int degree) {
    	if(f)return;
    	if(n==0) {

    		//System.out.println(degree);
    		if(degree==0||degree==360||degree==-360) {
    			System.out.println("YES");
    			f=true;
    			System.exit(0);

    		}

    	}
    	else if(i>=a.length)return;
    	else {
    		//System.out.println(i);
    		helper(i+1,a,n-1,degree-a[i]);
    		helper(i+1,a,n-1,degree+a[i]);

    	}
    }

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//run();
		//EhabTheXorcist();
//		long x1=699050&349525;
//		long x2=699050|349525;
//		long a=x1*x1;;
//		long b=x2*x2;
//		long s=1<<20;
//		long f=s|(~s);
//		System.out.println(b);
		//ANDORAndSquareSum();
		//Hotelier();
		 //GameWithString() ;
		//SerejaAndSuffixes();
		//HitTheLottery();
		//PolycarpTraining2();
		//System.out.println(daysAtindex(3,4));
		//RequiredRemainder();
		//MultiplyBy2DivideBy6();
		//GameWithArray2();
		//MagicalSticks();
		//QAQ();
		PetrAndACombinationLock();
		System.out.println("NO");

	}

}

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

public class dpcodeforces {

        static 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]; // line length
            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();
        }
    }
    static class Comb {

        static long nCr(int n, int k) {
            long C[] = new long[k + 1];

            // nC0 is 1
            C[0] = 1;

            for (int i = 1; i <= n; i++) {
                for (int j = Math.min(i, k); j > 0; j--) {
                    C[j] = C[j] + C[j - 1];
                }
            }
            return C[k];
        }
    }

    static boolean rotate(int []arr,int i,int sum){
       boolean a=false;
        if(sum==0||sum==360){
            a=true;
        }

        if(i<arr.length){
        rotate(arr,i+1,sum+arr[i]);
        rotate(arr,i+1,sum-arr[i]);
        }
        return a;

    }
    public static void main(String[] args) throws IOException {
        //int mod = 1000000007;
        Reader rd = new Reader();
        //StringBuilder sb = new StringBuilder();
        int n=rd.nextInt();
        int v[]=new int[n];
        for (int i = 0; i < n; i++) {
            v[i]=rd.nextInt();
        }
        if(rotate(v,1,v[0])){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }

    }

}

/*

 */

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		sc.nextLine();
		int[] numbers = new int[t];
		boolean flag = false;
		int i = 0;
		while(i < t) {
			numbers[i] = sc.nextInt();
			i++;
		}
		for(int mask = 0; mask < (1 << t); mask++) {
			int rotation1 = 0, rotation2 = 0;
			for(i = 0; i < t; i++) {
				int a = mask & (1 << i);
				if(a != 0) {
					rotation1 += numbers[i];
				}
				else {
					rotation2 += numbers[i];
				}
			}
			System.out.println("rotation1 " + rotation1);
			System.out.println("rotation2 " + rotation2);
			if((rotation1 == rotation2) || (rotation1 == 360 && rotation2 == 0)) {
				flag = true;
				System.out.println("YES");
				break;
			}

		}
		if(flag == false) {
			System.out.println("NO");
		}

		sc.close();
	}
}

import java.util.*;
public class PetrAndACombinationLock {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=new int[n];
		ArrayList<Integer> foo=new ArrayList<>();
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		if(n==1) {
			if(arr[0]==0 || arr[0]==360) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		foo.add(arr[0]+arr[1]);
		foo.add(arr[0]-arr[1]);
		if(n==2) {
			if(arr[0]==0 || arr[0]==360 || arr[1]==0 || arr[1]==360) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		int k=2,r=2;
		for(int i=0;i<Math.pow(2, n-2);i++) {
			for(int j=0;j<r;j++) {
				//System.out.println(k);
				foo.add(foo.get(0)+arr[k]);
				foo.add(foo.get(0)-arr[k]);
				foo.remove(0);
			}
			r=r*2;
			k++;
			if(k==n) {
				break;
			}
		}
		//System.out.println(foo.size()+"bhai");
		//for(int i=0;i<foo.size();i++) {
			//System.out.println(foo.get(i));
		//}
		if(foo.contains(0) || foo.contains(360)) {
			//System.out.println("////");
			//System.out.println(foo.indexOf(0));
			//System.out.println(foo.indexOf(360));
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.sql.Array;
import java.util.*;

public class Main {
    public static void main(String[] args)  {
       __SolutionBase begin = new __SolutionBase();
       begin.Solve();
    }
}
class __SolutionBase {

    public void Solve() {
        init();
        Solution();
        out.close();
    }
    private void Solution(){
        int n = readInt();
        int[] gr = new int[n];
        int[] sum = new int[n];
        for (int i = 0;i < n;i++) gr[i] = readInt();
        Arrays.sort(gr);
        sum[0] = gr[0];
        for (int i = 1;i < n;i++) sum[i] = sum[i-1] + gr[i];
        if (sum[n - 1] % 360 == 0){
            out.println("YES");
            return;
        }
        for (int i = n - 2;i >= 0 ;i--) {
            if (sum[i] == (sum[n - 1] - sum[i])) {
                out.println("YES");
                return;
            }
        }
        int find = sum[n - 1]/2;
        int check = 0;
        for (int i = 0;i < n;i++){
            check += gr[i];
            for (int j = i; j < n; j++){
                if (check + gr[j] == find){
                    out.println("YES");
                    return;
                }
            }
        }
        out.println("NO");
    }

    /**
     * readLong, readDouble and other are similar
     *
     * @return int type from input
     */
    private int readInt() {
        return Integer.parseInt(readString());
    }

    private long readLong() {
        return Long.parseLong(readString());
    }
    /**
     * Tokens are separated by space or endExclusive of line
     *
     * @return non-empty string token from input (or null if there is no any token)
     */
    private String readString() {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) return null;
            tok = new StringTokenizer(nextLine);
        }

        return tok.nextToken();
    }

    /**
     * @return whole line from input
     */
    private String readLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer(" ");

    /**
     * For local testing I use pair 'input.txt'/'output.txt' in the project root
     */
    private void init() {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (FileNotFoundException e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.*;

import static java.lang.Integer.parseInt;

/**
 * Created by Andrey on 31.12.2018.
 */
public class Stepic {
    static int scanInt() throws IOException {
        return parseInt(scanString());
    }

    static String scanString() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    static BufferedReader in;
    static StringTokenizer tok;

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));

        int n = scanInt();

        int[] arr = new int[n];

        for (int i = 0; i < n; ++i) {
            arr[i] = scanInt();
        }

        for (int i = 0; i < (1 << n); ++i) {
            int temp = 0;
            for (int j = 0; j < n; ++j) {
                if ((i & (1 << j)) != 0) {
                    temp += arr[j];
                } else {
                    temp -= arr[j];
                }
            }

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

        System.out.println("NO");

    }

}

import java.awt.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class PA {

    public static boolean backtrack(int arr[] , int sum , int i)
    {
        if(i == arr.length) {

            return (sum == 0 || sum == 360);

        }

        return backtrack(arr , sum + arr[i] , i+1) || backtrack(arr , sum - arr[i] , i+1);

    }

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

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

        int n = Integer.parseInt(br.readLine());
        int arr[] = new int [n];

        for(int i = 0 ; i < n ; i++)
        {
            arr[i] = Integer.parseInt(br.readLine());
        }

        if(backtrack(arr , 0 , 0))
            out.println("YES");
        else
            out.println("NO");

        out.flush();
        out.close();

    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inclass in = new inclass(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrAndACombinationLock {
        int n;

        public void solve(int testNumber, inclass in, PrintWriter out) {
            n = in.nextInt();
            int arr[] = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            if (rec(0, new int[n], 0, arr)) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

        public boolean rec(int idx, int[] arr, int count, int[] real) {
            if (count == n) {
                if (ok(arr, real)) {
                    return true;
                }
                return false;
            }
            arr[idx] = 1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            arr[idx] = -1;
            if (rec(idx + 1, arr, count + 1, real)) {
                return true;
            }
            return false;
        }

        private boolean ok(int[] ones, int[] arr) {
            int sum = 0;
            for (int i = 0; i < ones.length; i++) {
                arr[i] = ones[i] * arr[i];
                sum += arr[i];
            }
            return sum % 360 == 0;
        }

    }

    static class inclass {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private inclass.SpaceCharFilter filter;

        public inclass(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class ProblemB {
	public static void main(String [] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		Map<Integer, Integer>counts = new HashMap<Integer, Integer>();
		List<Integer>nums = new ArrayList<Integer>();
		int sum = 0 ;

		for(int i = 0; i < n; i++){
			nums.add(scanner.nextInt());

			if(counts.containsKey(nums.get(i))){
				counts.put(nums.get(i), counts.get(nums.get(i)) + 1);
			}else{
				counts.put(nums.get(i), 1);
			}

			sum+= nums.get(i);
		}

		Collections.sort(nums);
		Collections.reverse(nums);

		if(sum%360 == 0){
			System.out.println("YES");
		}else{

			if(sum > 360){
				Collections.reverse(nums);
				sum%= 360;
			}

			int div = sum/2;

			boolean flag = false;

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

				int com = div - nums.get(i);

				if(com < 0){
					System.out.println("NO");
					return;

				}else if(nums.get(i) > div){
					continue;
				}else if(com == 0 || counts.containsKey(com)){
					System.out.println("YES");
					return;
				}else{
					for(Entry<Integer, Integer> entry : counts.entrySet()){
						if(entry.getKey() * entry.getValue() == com || (com % entry.getKey() == 0 && entry.getValue() > com / entry.getKey())){
							System.out.println("YES");
							return;
						}
					}
				}
			}

			System.out.println("NO");
			return;

		}
	}
}

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), a[] = new int[n+1];

        for(int i = 1; i<=n; i++) a[i] = in.nextInt()+a[i-1];

        for(int i = 1; i<=n; i++){
            //a[i] - текущая сумма
            if(a[i]==a[n]-a[i] || (i==n && a[i]%360==0)){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }

}

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), a[] = new int[n+1];

        for(int i = 1; i<=n; i++) a[i] = in.nextInt()+a[i-1];
        for(int i = 0; i<=n; i++){
            if((2*a[i]-a[n])%360==0){
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
    }

}

import java.util.*;
public class PetrAndACombinationLock {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=new int[n];
		ArrayList<Integer> foo=new ArrayList<>();
		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		if(n==1) {
			if(arr[0]==0 || arr[0]==360) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		foo.add(arr[0]+arr[1]);
		foo.add(arr[0]-arr[1]);
		if(n==2) {
			if(foo.contains(0) || foo.contains(360)) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
			return;
		}
		int k=2,r=2;
		for(int i=0;i<Math.pow(2, n-2);i++) {
			for(int j=0;j<r;j++) {
				//System.out.println(k);
				foo.add(foo.get(0)+arr[k]);
				foo.add(foo.get(0)-arr[k]);
				foo.remove(0);
			}
			r=r*2;
			k++;
			if(k==n) {
				break;
			}
		}
		//System.out.println(foo.size()+"bhai");
		//for(int i=0;i<foo.size();i++) {
			//System.out.println(foo.get(i));
		//}
		if(foo.contains(0) || foo.contains(360)) {
			//System.out.println("////");
			//System.out.println(foo.indexOf(0));
			//System.out.println(foo.indexOf(360));
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int arr[] = new int[n];
		int sum = 0;
		for(int i = 0; i < n; i++) {
			arr[i] = s.nextInt();
			sum += arr[i];
		}
		if(sum % 360 == 0) {
			System.out.println("YES");
			return;
		}
		for(int i = 0; i < n; i++) {
			int currsum = arr[i];
			for(int j = i + 1; j < n; j++) {
				currsum += arr[j];
				if((currsum%360) == ((sum - currsum)%360)) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");

	}

}

import java.util.*;
public class PetrAndACombinationLock {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int arr[]=new int[n];
		ArrayList<Integer> foo=new ArrayList<>();

		for(int i=0;i<n;i++) {
			arr[i]=sc.nextInt();
		}
		foo.add(arr[0]+arr[1]);
		foo.add(arr[0]-arr[1]);
		for(int i=0;i<Math.pow(2, n-2);i++) {
			for(int j=2;j<n;j++) {
				foo.add(foo.get(0)+arr[j]);
				foo.add(foo.get(0)-arr[j]);
			}
			foo.remove(0);
		}
		//for(int i=0;i<foo.size();i++) {
			//System.out.println(foo.get(i));
		//}
		if(foo.contains(0) || foo.contains(360)) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}

	}

}

import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String ag[])
    {
        Scanner sc=new Scanner(System.in);
        int i,j,k;
        int N=sc.nextInt();
        int A[]=new int[N+1];
        for(i=0;i<N;i++)
        A[i]=sc.nextInt();
        int dp[]=new int[N];
        Arrays.fill(dp,-1);
        if(find(0,0,N,A,dp)==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
    public static int find(int id,int sum,int N,int A[],int dp[])
    {
        if(id==N)
        {
            if(sum==0||sum==360)
            return 1;
            return 0;
        }
        if(dp[id]!=-1)
        return dp[id];

        return dp[id]=Math.max(dp[id],Math.max(find(id+1,sum+A[id],N,A,dp),find(id+1,sum-A[id],N,A,dp)));
    }
}

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class ProblemB {
	public static void main(String [] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		Map<Integer, Integer>counts = new HashMap<Integer, Integer>();
		List<Integer>nums = new ArrayList<Integer>();
		int sum = 0 ;

		for(int i = 0; i < n; i++){
			nums.add(scanner.nextInt());

			if(counts.containsKey(nums.get(i))){
				counts.put(nums.get(i), counts.get(nums.get(i)) + 1);
			}else{
				counts.put(nums.get(i), 1);
			}

			sum+= nums.get(i);
		}

		Collections.sort(nums);
		Collections.reverse(nums);

		if(sum%360 == 0){
			System.out.println("YES");
		}else{

			sum%= 360;
			int div = sum/2;
			for(int i = 0; i < n; i++){
				int com = div - nums.get(i);

				if(nums.get(i) > div){
					continue;
				}else if(com == 0 || counts.containsKey(com)){
					System.out.println("YES");
					return;
				}else{
					for(Entry<Integer, Integer> entry : counts.entrySet()){
						if(entry.getKey() * entry.getValue() == com || (com % entry.getKey() == 0 && entry.getValue() > com / entry.getKey())){
							System.out.println("YES");
							return;
						}
					}

					System.out.println("NO");
					return;
				}
			}

		}
	}
}

import java.io.*;
import java.util.*;
public class Solution
{
    public static void main(String ag[])
    {
        Scanner sc=new Scanner(System.in);
        int i,j,k;
        int N=sc.nextInt();
        int A[]=new int[N+1];
        for(i=0;i<N;i++)
        A[i]=sc.nextInt();
        int sum=0;
        for(i=0;i<N;i++)
        sum+=A[i];
        int dp[][]=new int[N][sum+1];
        for(i=0;i<N;i++)
        Arrays.fill(dp[i],-1);
        if(find(0,sum,N,A,dp)==1)
        System.out.println("YES");
        else
        System.out.println("NO");
    }
    public static int find(int id,int sum,int N,int A[],int dp[][])
    {
        if(id==N)
        {
            if(sum%360==0)
            return 1;
            return 0;
        }
        if(dp[id][sum]!=-1)
        return dp[id][sum];
       // System.out.println(id+" "+sum);
        return dp[id][sum]=Math.max(dp[id][sum],Math.max(find(id+1,sum-A[id],N,A,dp),find(id+1,sum,N,A,dp)));
    }
}

import java.util.Arrays;
import java.util.Scanner;

public class B {

	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		int sum=0;
			for(int i=0;i<n;i++)
			{
				ar[i]=scan.nextInt();
				sum+=ar[i];
			}
			Arrays.sort(ar);
			int curr=0;
			if(Math.abs(sum)==360 || (Math.abs(sum)%360==0 && sum!=0)){
				System.out.println("YES");
				return;
			}

			for(int i=0;i<n;i++)
			{
				curr+=ar[i];

				int now=sum-curr;
				if(curr==now)
				{
					System.out.println("YES");
					return;				}
			}
			System.out.println("NO");
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author dmytro.prytula
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrIKodoviiZamok solver = new BPetrIKodoviiZamok();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrIKodoviiZamok {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            int[] a = in.nextArr(n);

            int MAX = 1 << n;

            for (int i = 1; i < MAX; i++) {
                long res = 0L;
                char[] arr = toBi(i, n).toCharArray();
                int k = 0;
                for (char c : arr) {
                    res += (c == '1') ? a[k] : -a[k];
                    k++;
                }
                if (res == 0 || res == 360) {
                    out.print("YES");
                    return;
                }
            }
            out.print("NO");
        }

        private String toBi(int i, int n) {
            String bits = Integer.toString(i, 2);
            StringBuilder sb = new StringBuilder();

            for (int toPrepend = n - bits.length(); toPrepend > 0; toPrepend--) {
                sb.append('0');
            }
            sb.append(bits);
            return sb.toString();
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String nextToken() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public int[] nextArr(int size) {
            return Arrays.stream(new int[size]).map(c -> nextInt()).toArray();
        }

    }
}

import java.util.*;
public class Combination
{
	static int flag=0;
	static void rotate(int rot[],int n,int sum)
	{
		if(n==0&&(sum==0||sum==360))
		{
			flag=1;
			return;
		}
		if(n>0)
		{
			rotate(rot,n-1,sum+rot[n-1]);
			rotate(rot,n-1,sum-rot[n-1]);
		}

	}
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int rot[]=new int[n];
		for(int i=0;i<n;i++)
		{
			rot[i]=sc.nextInt();
		}
		rotate(rot,n,0);
		if(flag==1)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
}

import java.io.*;
import java.sql.Array;
import java.util.*;

public class Main {
    public static void main(String[] args)  {
        __SolutionBase begin = new __SolutionBase();
        begin.Solve();
    }
}
class __SolutionBase {

    public void Solve() {
        init();
        Solution();
        out.close();
    }
    private void Solution(){
        int n = readInt();

        int[] gr = new int[n];
        int[] sum = new int[n];
        for (int i = 0;i < n;i++) gr[i] = readInt();
        Arrays.sort(gr);
        sum[0] = gr[0];
        if ( n == 1 )
            out.println("NO");

        for (int i = 1;i < n;i++) sum[i] = sum[i-1] % 360 + gr[i];
        if (sum[n - 1] % 360 == 0){
            out.println("YES");
            return;
        }
        /*
        for (int i = n - 2;i >= 0 ;i--) {
            if (sum[i] == (sum[n - 1] - sum[i])) {
                out.println("YES");
                return;
            }
        }
        */
        int find = sum[n - 1]/2;
        int check = 0;
        if (n == 2){
            out.println(gr[0] == gr[1] ? "YES":"NO");
            return;
        }
        if (sum[n - 1] % 2 == 1 && n % 2 == 1){
            out.println("NO");
            return;
        }

        for (int i = 0;i < n;i++){
            check += gr[i];
            for (int j = i + 1; j < n; j++){
                if (check + gr[j] == find){
                    out.println(i + "" + j);
                    out.println("YES");
                    return;
                }
            }
        }
        out.println("NO");
    }

    /**
     * readLong, readDouble and other are similar
     *
     * @return int type from input
     */
    private int readInt() {
        return Integer.parseInt(readString());
    }

    private long readLong() {
        return Long.parseLong(readString());
    }
    /**
     * Tokens are separated by space or endExclusive of line
     *
     * @return non-empty string token from input (or null if there is no any token)
     */
    private String readString() {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) return null;
            tok = new StringTokenizer(nextLine);
        }

        return tok.nextToken();
    }

    /**
     * @return whole line from input
     */
    private String readLine() {
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer(" ");

    /**
     * For local testing I use pair 'input.txt'/'output.txt' in the project root
     */
    private void init() {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (FileNotFoundException e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }
}

import java.io.*;
import java.util.*;
public class Combilock
{
	public static void main(String args[])throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int arr[] = new int[n];
		for(int i=0;i<n;i++)
		{
			arr[i]= Integer.parseInt(br.readLine());
		}
		for(int j=0;j<1<<n;j++)
		{
			int sum=0;
		for(int i=0;i<n;i++)
		{
			if((j&i)==0){
				// System.out.print("+" + arr[i]);
				sum+=arr[i];
			}
			else{
				// System.out.print("-" + arr[i]);
				sum-=arr[i];
			}
		}
		// System.out.println(" = "+ sum);
		if(sum%360==0){
			System.out.println("YES");
			return;
		}
		}
		System.out.println("NO");
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.LinkedList;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Emmanuell
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BPetrAndACombinationLock solver = new BPetrAndACombinationLock();
        solver.solve(1, in, out);
        out.close();
    }

    static class BPetrAndACombinationLock {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int sum = 0;

            ArrayList<Integer> possibities = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                int a = in.nextInt();
                if (possibities.isEmpty()) {
                    possibities.add(a);
                } else {
                    LinkedList<Integer> list = new LinkedList<>();
                    for (int j = 0; j < possibities.size(); j++) {
                        Integer x = possibities.get(j);
                        list.add(x - a);
                        list.add(x + a);
                    }
                    out.println(list);
                    possibities.clear();
                    possibities.addAll(list);
                }
            }
            if (possibities.contains(0) || possibities.contains(360)) {
                out.println("YES");
            } else {
                out.println("NO");
            }

        }

    }
}

import java.util.*;

public class square{

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
     int n=sc.nextInt();
     int[] a=new int[n];
     int sum=0;
     for(int i=0;i<n;i++){a[i]=sc.nextInt();sum+=a[i];
        }
     if(sum%360==0){
         System.out.println("YES");return;
     }

     if(sum%2!=0){
        System.out.println("NO");return;
     }
    for(int i=0;i<Math.pow(2,n);i++)
    {
        sum=0;
        for(int j=0;j<n;j++)
        {
if((i & (1<<j))==1)sum+=a[j];
else sum-=a[j];
        }
        if(sum%360==0){System.out.println("YES");return;}
    }

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

/*
USER: caoash3
LANG: JAVA
TASK:
*/

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

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

		//BufferedReader br = new BufferedReader(new FileReader("X.in"));
		//PrintWriter pw = new PrintWriter(new FileWriter("X.out"));

		X solver = new X();
		solver.solve(br, pw);
	}

	static class X {
		public void solve(BufferedReader br, PrintWriter pw) throws IOException {

			int n = Integer.parseInt(br.readLine());

			int[] in = new int[n];

			LinkedList<Integer> set = new LinkedList<Integer>();

			Arrays.sort(in);

			for(int i = 0; i < n; i++) {
				in[i] = Integer.parseInt(br.readLine());
			}
			int sum = in[0];
			int cnt = in[0];
			for(int i = 0; i < n-1; i++) {
				if(cnt - in[i+1] == 0) {
					cnt = 0;
					sum += in[i+1];
				}
				else {
					cnt += in[i+1];
					sum += in[i+1];
				}

				if(sum == 360) {
					pw.println("YES");
					pw.close();
				}
			}

			pw.println(cnt == 0 ? "YES" : "NO");

			pw.close();
		}
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class B {

public static int minimumSum(int[] array)
{
      int counter1, counter2, minimumSum;
      int n = array.length;
      counter1 = array[n-1];
      counter2 = array[n-2];
      // It is assumed that the array is sorted.
      int i = n-3;
      while(i>=0)
      {
          if(counter1 > counter2)
          {
              counter2 = counter2 + array[i];
          }
          else
          {
              counter1 = counter1 + array[i];
          }
          i--;
      }
      if(counter1 > counter2)
      {
          minimumSum = counter1 - counter2;
      }
      else
          minimumSum = counter2 - counter1;
      return minimumSum ;
}
	public static void main(String args[])
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int ar[]=new int[n];
		int sum=0;
			for(int i=0;i<n;i++)
			{
				ar[i]=scan.nextInt();
				sum+=ar[i];
			}
			Arrays.sort(ar);

			if(sum==0 ||(sum==360) || (sum%360==0)){
				System.out.println("YES");
				return;
			}
			int gg=minimumSum(ar);
			if(gg==0)
			{
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
	}
}

    import static java.lang.System.exit;
    import java.util.ArrayList;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Scanner;
    import java.util.*;
    /**
     *
     * @author abdelmagied
     */
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    import java.util.Scanner;

    /*
     * @author abdelmagied
    */

public class JavaApplication1 {
       /**
        *    @param args the command line arguments
        */

      public static int n;
      public static int[] arr;
       public static void main(String[] arg){
          Scanner sc = new Scanner(System.in);

            n = sc.nextInt();
           arr = new int[n];
           int sum = 0;

        for(int i = 0 ; i < n ; i++){
               arr[i]  = sc.nextInt();
               sum += arr[i];
          }
        if(sum % 2 != 0){//odd case
              System.out.println("NO");
          }else if(sum == 360){
              System.out.println("YES");
          }else{
                if(check(0 , 0  , sum/2 , sum/2) == true){
                    System.out.println("YES");
                }else{
                    System.out.println("NO");
                }
          }

       }
        public static boolean check(int pos , int sum , int num , int rem){
            if(sum == num && rem == 0)
                return true;
            if(pos >= n)
                return false;

            boolean choice1 = check( pos+1 , sum-arr[pos] , num , rem + arr[pos]); // leave it..
            boolean choice2 = check( pos+1 , sum+arr[pos] , num , rem - arr[pos]); // take it..

            if(choice1 == true || choice2 == true)return true;
            return false;
       }

}

// 作者：杨成瑞先生
import java.io.*;
import java.util.*;

public class b {

	static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

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

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

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

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i=0;i<n;i++) a[i] = sc.nextInt();
        //System.out.println(Arrays.toString(a));

        ArrayList<Integer> a1 = new ArrayList<Integer>();
        a1.add(a[0]); a1.add(0 - a[0]);

        for(int i=1;i<n;i++) {
            ArrayList<Integer> a2 = new ArrayList<Integer>();
            for(int num : a1) {
                a2.add(num + a[i]); a2.add(num - a[i]);
            }
            a1 = new ArrayList<Integer>(a2);
        }

        //System.out.println(Arrays.toString(a1.toArray()));
        for(int num : a1) {
            if(num == 360) {
                System.out.println("YES");
                return;
            }
        }
        System.out.println("NO");
	}

}

import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		sc.nextLine();
		int[] numbers = new int[t];
		boolean flag = false;
		int i = 0;
		while(i < t) {
			numbers[i] = sc.nextInt();
			i++;
		}
		for(int mask = 0; mask < (1 << t); mask++) {
			int rotation1 = 0;
			for(i = 0; i < t; i++) {
				int a = mask & (1 << i);
				if(a != 0) {
					rotation1 += numbers[i];
				}
				else {
					rotation1 -= numbers[i];
				}
			}
			System.out.println("rotation1 " + rotation1);
			//System.out.println("rotation2 " + rotation2);
			//if(rotation2 == 360) {
				//System.out.println("Above is 360");
			//}
			if(rotation1 % 360 == 0) {
				flag = true;
				System.out.println("YES");
				break;
			}

		}
		if(flag == false) {
			System.out.println("NO");
		}

		sc.close();
	}
}

/*
USER: caoash3
LANG: JAVA
TASK:
*/

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

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));

		//BufferedReader br = new BufferedReader(new FileReader("X.in"));
		//PrintWriter pw = new PrintWriter(new FileWriter("X.out"));

		X solver = new X();
		solver.solve(br, pw);
	}

	static class X {
		public void solve(BufferedReader br, PrintWriter pw) throws IOException {

			int n = Integer.parseInt(br.readLine());

			int[] in = new int[n];

			LinkedList<Integer> set = new LinkedList<Integer>();

			Arrays.sort(in);

			for(int i = 0; i < n; i++) {
				in[i] = Integer.parseInt(br.readLine());
			}
			int sum = in[0];
			int cnt = in[0];
			for(int i = 0; i < n-1; i++) {
				if(cnt - in[i+1] == 0) {
					cnt = 0;
					sum += in[i+1];
				}
				else {
					cnt += in[i+1];
					sum += in[i+1];
				}

			}

			if((sum+cnt) % 360 == 0) {
				pw.println("YES");
				pw.close();
			}

			pw.println(cnt == 0 ? "YES" : "NO");

			pw.close();
		}
	}
}

import java.util.*;

public class square{

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

     for(int i=0;i<n;i++)a[i]=sc.nextInt();

    for(int i=0;i<Math.pow(2,n);i++)
    {
        int sum=0;
        for(int j=0;j<n;j++)
        {
if((i&(1<<j))==1)sum+=a[j];
else sum-=a[j];
        }
        if(sum%360==0){System.out.println("YES");return;}
    }

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

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

public class PetrAndCombinationLock {
    public static void main(String[] args) {
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = in.nextInt();
        int[] nums = new int[n];
        boolean ok = false;
        for (int i = 0; i < n; i++)
            nums[i] = in.nextInt();
        for (int mask = 0; mask < (1 << n); mask++) {
            int sum = 0;
            for (int i = 0; i < n; i++) {
                if ((mask & (1 << i)) >= 1)
                    sum += nums[i];
                else
                    sum -= nums[i];
            }
            if (sum == 0 || sum == 360) {
                ok = true;
                break;
            }
        }

        out.println((ok) ? "YES" : "NO");

        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        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());
        }

        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 input = new Scanner(System.in);
		int n  = input.nextInt();
		int [] res = new int [n];
		for(int i = 0;i < n;i ++){
			res[i] = input.nextInt();
		}
		for(int i = 0;i < (1 << n);i ++){
			int num = 0;
			for(int j = 0;j < n;j ++){
				if((i & (1 << j)) != 0) num += res[j];
				else num -= res[j];
			}
			if(num % 360 == 0){
				System.out.println("YES");
				System.exit(0);
			}else {
				System.out.println("NO");
				System.exit(0);
			}

		}

	}

}

/*
   @author :: Abhimanyu Chauhan
*/

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

public class TaskA implements Runnable{

    long ar[];
    public void solve(){
        int n = scan.nextInt();
        ar = new long[n];
        long s =0L;
        for(int i=0;i<n;i++){
            ar[i] = scan.nextLong();
            s+=ar[i];
        }
        if(s%360==0){
            out.print("YES");
        }else
        out.println(fun(s,0,0)?"YES":"NO");
    }

    boolean fun(long s,long z,int i){
        if(s==z) return true;
        if(i>=ar.length) return false;
        return fun((s-ar[i]),(z+ar[i])%360,i+1)||fun(s,z%360,i+1);
    }

    InputReader scan;
    PrintWriter out;

    @Override
    public void run(){
        scan = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null,new TaskA(),"Main",1<<26).start();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}

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

public class Main {
	public static void main(String[]args) throws IOException{
	   	 PrintWriter pw=new PrintWriter(System.out);
	   	 BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	   	 String x1=br.readLine();
	   	 StringTokenizer st=new StringTokenizer(x1);
	   	 int n=Integer.parseInt(st.nextToken());
	   	 int[]x=new int[n];
	   	 int s=0;
	   	 for(int i=0;i<n;i++){
	   		 String x2=br.readLine();
		   	 StringTokenizer st2=new StringTokenizer(x2);
		   	 int z=Integer.parseInt(st2.nextToken());
		   	 if(z>=360)
		   		 z=z%360;
		   	 x[s++]=z;
	   	 }
	   	 //for(int i=0;i<x.length;i++)
	   		// pw.print(x[i]+" ");
	   	 int t=0;

	   	int sol= solve(x,0,t);
	   	if(sol==0)
	   		pw.println("YES");
	   	else
	   		pw.println("NO");
	   	pw.close();
}

	public static int solve(int[]x,int idx,int t){
		 PrintWriter pw=new PrintWriter(System.out);
		 int t1=0;
			int t2=0;
		if(idx==x.length){
			if(t>=360)
				t=t%360;

			//pw.println(t);
			//pw.flush();
			return t;
		}
		//if(x[idx]>360)
			//x[idx]=x[idx]%360;
		if(t+x[idx]>=360)
			t1=t1%360;
		if(t-x[idx]>=360)
			t2=t2%360;

		else{
			t1=t+x[idx];
		 t2=t-x[idx];
		}

		return Math.min(Math.abs(solve(x,idx+1,t1)),Math.abs(solve(x,idx+1,t2)));
	}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.*;
/**
 *
 * @author arvin
 */
public class Petr_combination_lock {
    static int a[];
    static int n,val;
    static int b[][];
    static int rec(int i,int sum)
    {
        if(val==sum)
        {
            System.out.println("YES");
            return 1;
        }
        if(sum==360)
        {
            val-=180;
            sum=0;
        }
        if(sum>val && sum>360)
        {
            return 0;
        }
        for(int j=i;j>0;j--)
        {
            int ans;
            if(b[j][sum+a[j]]==-1)
            {
                ans=rec(j-1,sum+a[j]);
                b[j][sum+a[j]]=ans;
            }
            else
                ans=b[j][sum+a[j]];
            if(ans==1)
                return 1;
        }
        return 0;
    }
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        a=new int[n+1];
        b=new int[16][5000];
        for(int i=0;i<16;i++)
            Arrays.fill(b[i],-1);
        int sum=0;
        a[0]=0;
        for(int i=1;i<=n;i++)
        {
            a[i]=sc.nextInt();
            sum+=a[i];
        }
        val=0;
        if(sum%360==0)
        {
            System.out.println("YES");
            return;
        }
        if(sum%2==1)
        {
            System.out.println("NO");
            return;
        }
        else
            val=sum/2;

        Arrays.sort(a);
        int z=rec(n,a[n]);
        if(z==0)
            System.out.println("NO");

        sc.close();
    }
}

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

	public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       int n=sc.nextInt();
              int pow=(int)Math.pow(2,n);

       int arr[]=new int[n+1];
       for(int i=0;i<n;i++){
       	arr[i]=sc.nextInt();
       }
       int brr[]=new int[2*pow+3];
       brr[0]=arr[0];
       for(int i=0;i<n;i++){
       	if(i!=n-1){

          brr[2*i+1]=brr[i]+arr[i+1];
          brr[2*i+2]=brr[i]-arr[i+1];
      }else{
 brr[2*i+1]=brr[i]+arr[i];
          brr[2*i+2]=brr[i]-arr[i];      }
       }
              int pow2=(int)Math.pow(2,n-1);

       for(int i=n;i<=pow-2;i++){
       	 brr[2*i+1]=brr[i]+brr[i+1];
          brr[2*i+2]=brr[i]-brr[i+1];
       }

       for(int i=pow-2;i>=pow2-1;i--){
      // 	System.out.println(brr[i]);
       	if(brr[i]%360==0){
       		System.out.println("YES");
       		return;
       	}

       }
       System.out.println("NO");
 // for(int i=0;i<=pow-2;i++){
 // 	System.out.print(brr[i]+" ");
 // }

	}

}

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

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(1, in, out);
        out.close();
    }

    static class Solve {
    	static int[] combi = new int[16];
    	static int n1;
    	public static boolean comb (int n, int ind) {
    		if(n<=-360)n+=360;
    		if(ind==n1) {
    			if(n==0) return true;
    			else return false;
    		}
    		return comb(n+combi[ind]%360,ind+1)|comb(n-combi[ind]%360, ind+1);
    	}

    	public void solve(int testNumber, InputReader in, OutputWriter out) {
    		n1 = in.nextInt();
    		for(int i = 0;i<n1;i++) combi[i] = in.nextInt();
    		if(comb(0,0)) out.println("YES");
    		else out.println("NO");
        }
    }

    static class OutputWriter {
	    private final PrintWriter writer;

	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }

	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }

	    public void close() {
	        writer.close();
	    }

	    public void println(String string) {
	        writer.println(string);
	    }

	    public void println(int number) {
	        writer.println(number);
	    }

	    public void println(long number) {
	        writer.println(number);
	    }

	    public void println(double number) {
	    	writer.println(number);
	    }

	    public void print(long number) {
	        writer.print(number);
	    }

	    public void print(int number) {
	        writer.print(number);
	    }

	    public void print(String string) {
	        writer.print(string);
	    }

	    public void print(double number) {
	    	writer.print(number);
	    }
	}

	static class InputReader {
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

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

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

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

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}

import java.util.Arrays;
import java.util.Scanner;

public class TestInt {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int [] rot = new int[n];
        int sum = 0;
        for(int i=0; i<n; i++) {
            rot[i] = s.nextInt();
            sum += rot[i];
        }
        int i =0;
        while(sum > 0){
            sum -= 2*rot[i];
            i++;
        }
        if(sum == 0)
            System.out.println("YES");
        else
            System.out.println("NO");
    }
}

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

public class PetrAndCombinationLock {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        int [] degree = new int[n];
        for (int i = 0; i < n; i++) {
            degree[i]=Integer.parseInt(bf.readLine());
        }
        for (int mask = 0; mask < (1<<n); mask++) {
            int sum=0;
            for (int i = 0; i < n; i++) {
                if ((mask&(1<<i))!=0){
                    sum+=degree[i];
                }
                else
                    sum-=degree[i];
            }
            if (sum==0||sum==360) {
                System.out.print("YES");
                return;
            }
        }
        System.out.print("NO");
    }
}

import java.io.*;
public class Combination_Lock {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		int sum = 0;
		for (int i = 0;i<n;i++)
		{
			arr[i] = Integer.parseInt(br.readLine());
			sum += arr[i];
		}
		if (sum==360)
		{
			System.out.println("YES");
		}
		else if(sum%2!=0)
		{
			System.out.println("NO");
		}
		else
		{
			sum = sum/2;
			boolean[][] dp = new boolean[n][sum+1];
			for (int i=0;i<dp.length;i++)
			{
				for (int j=0;j<dp[0].length;j++)
				{
					if (j==0)
						dp[i][j] = true;
					else if(i==0)
						dp[0][j] = arr[0]==j;
					else if (j<arr[i])
						dp[i][j] = dp[i-1][j];
					else
						dp[i][j] = dp[i-1][j]||dp[i-1][j-arr[i]];
				}
			}
			System.out.println(dp[n-1][sum]?"YES":"NO");
		}

	}

}

import java.util.*;

public class Test {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), p[] = new int[n], a[] = new int[n+1];

        for(int i = 0; i<n; i++) p[i] = in.nextInt();
        Arrays.sort(p);

        for(int i = 1; i<=n; i++){
            a[i] = p[i-1]+a[i-1];
        }

        for(int i = 1; i<=n; i++){

            if(a[i]%360==(a[n]-a[i])%360){
                System.out.println("YES");
                return;
            }

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

}

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

import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Integer.parseInt;

/**
 * Created by Andrey on 31.12.2018.
 */
public class Main {
    static int scanInt() throws IOException {
        return parseInt(scanString());
    }

    static String scanString() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    static BufferedReader in;
    static StringTokenizer tok;
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        Locale.setDefault(Locale.US);
        int n = scanInt();
        ArrayList<Integer> list = new ArrayList<>();
        int sum = 0;
        for(int i = 0; i < n; ++i){
            int q = scanInt();
            sum += q;
           list.add(q);
        }

        if(sum % 360 == 0){
            System.out.println("YES");
        }else {
            Collections.sort(list);

            while(list.size() != 3){
                int q = (int)(Math.ceil((double) list.size() / 2));
                int a = list.get(q);
                int b = list.get(q - 1);
                list.remove((Object)a);
                list.remove((Object)b);
                list.add(a+b);
            }

            if(list.get(2) - list.get(1) - list.get(0) == 0) {
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }

    }
}

/*
   @author :: Abhimanyu Chauhan
*/

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

public class TaskA implements Runnable{

    long ar[];
    public void solve(){
        int n = scan.nextInt();
        ar = new long[n];
        long s =0L;
        for(int i=0;i<n;i++){
            ar[i] = scan.nextLong();
            s+=ar[i];
        }
        if(s%360==0){
            out.print("YES");
        }else
        out.println(fun(s,0,0)?"YES":"NO");
    }

    boolean fun(long s,long z,int i){
        if(s==z) return true;
        if(i>=ar.length) return false;
        return fun((s-ar[i]),(z+ar[i])%360,i+1)||fun(s,z,i+1);
    }

    InputReader scan;
    PrintWriter out;

    @Override
    public void run(){
        scan = new InputReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();
    }

    public static void main(String[] args) {
        new Thread(null,new TaskA(),"Main",1<<26).start();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
                return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

}

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

public class hacker
{

    // YO fUCK PUSSY MAN
    // Believe yourself you gonna get it
    // Oh!love, oh mine ,gonna fuck you
    public static boolean[] sieve(long n)
    {
        boolean[] prime = new boolean[(int)n+1];
        Arrays.fill(prime,true);
        prime[0] = false;
        prime[1] = false;
        long m = (long)Math.sqrt(n);
        for(int i=2;i<=m;i++)
        {
            if(prime[i])
            {
                for(int k=i*i;k<=n;k+=i)
                {
                    prime[k] = false;
                }
            }
        }
        return prime;
    }

    static long GCD(long a,long b)
    {
        if(a==0 || b==0)
        {
            return 0;
        }
        if(a==b)
        {
            return a;
        }
        if(a>b)
        {
            return GCD(a-b,b);
        }
        return GCD(a,b-a);
    }

    static long CountCoPrimes(long n)
    {
        long res = n;
        for(int i=2;i*i<=n;i++)
        {
            if(n%i==0)
            {
                while(n%i==0)
                {
                    n/=i;
                }
                res-=res/i;
            }
        }
        if(n>1)
        {
            res-=res/n;
        }
        return res;
    }

    //fastest way to find x**n
    static long modularExponentiation(long x,long n,long m)
    {
        long res = 1;
        while(n>0)
        {
            if(n%2==1)
            {
                res = (res*x)%m;
            }
            x =(x*x)%m;
            n/=2;
        }
        return res;
    }

    static long lcm(long a,long b)
    {
        return (a*b)/GCD(a,b);
    }

    static long pow(long a,long b)
    {
        long res = 1;
        while(b>0)
        {
            if((b&1)==1)
            {
                res *= a;
            }

            b >>= 1;
            a *=a;
        }
        return res;
    }

   static long modInverse(long A,long M)
   {
    return modularExponentiation(A,M-2,M);
   }

    static boolean prime(int n)
    {
        for(int i=2;i*i<=n;i++)
        {
            if(i%2==0 ||i%3==0)
            {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) throws IOException
    {
      // = new PrintWriter("explicit.out");
        new hacker().run();

    }

    static int rev(int n)
    {
        int x=0;
        int num = 0;
        while(n>0)
        {
            x = n%10;
            num = num*10+x;
            n/=10;

        }
        return num;
    }

    // static int[][] board;
    static Scanner in = new Scanner(System.in);
    static void run() throws IOException
    {
        int n = ni();
        int[] a= new int[n];
        int sum=0;
        for(int i=0;i<n;i++)
        {
            a[i] = ni();
            sum+=a[i];
        }
        if(sum==360)
        {
            System.out.println("YES");
            return;
        }
        boolean flag =false;
        sum=0;
        for(int i=0;i<n;i++)
        {
            // sum+=a[i];
            if(a[i]==sum)
            {
                sum=0;
                if(i==n-1)
                {
                    flag = true;
                }
            }
            else
            {

                sum+=a[i];
            }
        }

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

    }

    static void printL(long a)
    {
        System.out.println(a);
    }
    static void printS(String s)
    {
        System.out.printf("%s\n",s);
    }

    static void swap(char c,char p)
    {
        char t = c;
        c = p;
        p = t;
    }

    static long max(long n,long m)
    {
        return Math.max(n,m);
    }
    static int min(int n,int m)
    {
        return Math.min(n,m);
    }

    static double nd() throws IOException
    {
        return Double.parseDouble(in.next());
    }
    static int ni() throws IOException
    {
        return Integer.parseInt(in.next());
    }

    static long nl() throws IOException
    {
        return Long.parseLong(in.next());
    }

    static String si() throws IOException
    {
        return in.next();
    }

    static long abs(long n)
    {
        return Math.abs(n);
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

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

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
            {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException {return br.ready();}

    }

}