42 lines
768 B
Java
42 lines
768 B
Java
package chelper;
|
|
|
|
import io.InputReader;
|
|
import io.OutputWriter;
|
|
import solutions.ChelperSolution;
|
|
|
|
|
|
public class TaskB extends ChelperSolution {
|
|
|
|
@Override
|
|
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
|
super.solve(testNumber, in, out);
|
|
}
|
|
|
|
@Override
|
|
public void solve(int testNumber) {
|
|
int n = in.nextInt();
|
|
|
|
int[] a = in.nextIntArray(n);
|
|
|
|
boolean ok = false;
|
|
|
|
for (int mask = 0; mask < 1 << n; mask++) {
|
|
int res = 0;
|
|
int t = mask;
|
|
for (int i = 0; i < n; i++) {
|
|
if ((t & 1) == 0) {
|
|
res += a[i];
|
|
} else {
|
|
res -= a[i];
|
|
}
|
|
t /= 2;
|
|
}
|
|
|
|
res = (res % 360 + 360) % 360;
|
|
ok |= res == 0;
|
|
}
|
|
|
|
out.println(ok ? "YES" : "NO");
|
|
}
|
|
}
|