403858: GYM101341 M Last Man Standing
Description
A company of n friends decided to play a multiplayer shooter in the Last Man Standing mode. The distinctive feature of this mode is when a player is killed, he does not respawn, but waits a round to finish. A round finishes when there is only one player alive.
You are given a notarized screenshot of the current fight results, made during the first round of the game. It provides an information about how many kills each player has made. You want to check if it's a fake or not, i.e. whether such situation could occur during the game.
InputThe first line contains a single integer n (1 ≤ n ≤ 200000) — the number of players.
The second line contains n integers ai separated by a space (0 ≤ ai ≤ 109) — the numbers of kills made by each player. These numbers are given in non-increasing order.
OutputIf such situation was not possible in the game, output «NO» (without quotes).
Otherwise, in the first line output «YES» (without quotes), and then output a log of kills in the round, consisting of k pairs of integers, where k is the total number of kills made at the moment of taking the screenshot. Each pair of integers in the log must consist of the number of the player who made the kill, and the number of the killed player, exactly in this order. Records in the log must be ordered chronologically. If there are several correct logs, output any of them.
ExamplesInput5Output
2 1 1 0 0
YESInput
3 5
2 4
1 3
1 2
7Output
3 2 2 0 0 0 0
NOInput
1Output
0
YESInput
3Output
1 0 0
YES
1 3