Little Chess Nim#4889

Little Chess Nim

1 second
64 megabytes
Medium

In the chess country, the game of Nim has gained immense popularity. The rules are straightforward: at the beginning of the game, several piles of stones are placed on a table. Two players take turns, and during each turn, a player can remove any number of stones from a single pile. The player who takes the last stone from the last remaining pile loses.

The black and white kings decided to play Nim, but found it too challenging, so they modified the rules: stones can only be taken from the pile with the fewest stones.

After several games, it became clear that the black king excelled at this version of the game and always made the optimal move. This means that if there is a move that guarantees victory, the black king will find it. Consequently, the white king began to suspect that the outcome of each game might be predetermined by the initial configuration of stones.

Now, he seeks your help, as the chief sage of the chess country, to determine whether he can win based on the initial number of stones in each pile. If a win is possible, he also wants to know how many stones he should take from the smallest pile on his first move to ensure victory.

Input

The first line of the input contains an integer — the number of piles (1 \leq n \leq 100).

The second line contains integers b_i (1 \leq b_i \leq 1000) — representing the number of stones in the -th pile.

Output

If the white king can win against the best play of the black king, print YES on the first line, and on the second line, print an integer , indicating how many stones the white king should take from the smallest pile on his first move.

If the white king cannot win, print NO on the first line.

Examples

Example 1

Loading
Loading