Author: | И. Блинов | Time limit: | 1 sec | |
Input file: | Standard input | Memory limit: | 512 Mb | |
Output file: | Standard output |
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?
The first line contains a single integer n. The next n lines contain integers ci.
Output YES if it is possible to make a tasty pizza; otherwise, output NO.
1 ≤ n ≤ 100000 1 ≤ ci ≤ 109
No. | Standard input | Standard output |
---|---|---|
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|