Problem J. Just pizza

Author:И. Блинов   Time limit:1 sec
Input file:Standard input   Memory limit:512 Mb
Output file:Standard output  

Statement

Elephant Pakhom is making a pizza, and he has exactly one pizza base, which is circular. For the toppings, he has n ingredients, each characterized by a number ci, indicating the sector of the pizza that can be covered by that ingredient (with 360 meaning it is sufficient for exactly one layer). To make the pizza tasty, the following conditions must be met:

Can Pakhom make a tasty pizza?

Input format

The first line contains a single integer n. The next n lines contain integers ci.

Output format

Output YES if it is possible to make a tasty pizza; otherwise, output NO.

Constraints

1 ≤ n ≤ 100000 1 ≤ ci ≤ 109

Sample tests

No. Standard input Standard output
1
3
360
720
720
YES
2
4
90
45
45
180
YES
3
5
180
180
180
180
180
NO
4
3
1080
180
180
NO

0.070s 0.007s 13