Espeon has the biggest mouth in the world, always claiming to be the number one psychic-type Pokémon, which incurs the wrath of Mewtwo. Sick of Espeon's constant boasting, Mewtwo challenges Espeon to a psychic duel with a stack of Z-Crystals.
The rules of the game are as follows. Mewtwo and Espeon take turns drawing a Z-Crystal from the top of the stack and reading its strength value $$$s$$$ $$$(1 \le s \le 100)$$$. The player then makes one of the following two choices:
To any other Pokemon, the strength values would be hidden until drawing the Z-Crystal, but since both Mewtwo and Espeon are Psychic types, they can use Future Sight to learn the strengths of all the Z-Crystals before the first card is drawn. Mewtwo, overly confident as always, allows Espeon to pick whether to go first or second. Unbeknownst to Mewtwo, Espeon is a highly skilled gamer, so Espeon knows that this choice can guarantee victory. Assuming both Mewtwo and Espeon play optimally, determine who wins if Espeon starts first.
The first line will be an integer $$$N$$$ ($$$1 \leq N \leq 10^5$$$), the number of Z-Crystals in the deck.
The next line will contain $$$N$$$ space-separated integers $$$s_i$$$ ($$$1 \leq s_i \leq 100$$$), the strengths of the Z-Crystals in the order they appear in the stack; the leftmost integer represents the Z-Crystal on the top of the stack at the start of the game.
If Espeon can win by going first, output "YES". Otherwise, output "NO". You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
21 1
YES
31 1 1
NO
55 3 1 1 1
NO
| Название |
|---|


