{"raw_statement":[{"iden":"statement","content":"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.\n\nYou 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.\n\nThe first line contains a single integer n (1 ≤ n ≤ 200000) — the number of players.\n\nThe 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.\n\nIf such situation was not possible in the game, output «_NO_» (without quotes).\n\nOtherwise, 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.\n\n"},{"iden":"input","content":"The 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."},{"iden":"output","content":"If 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."},{"iden":"examples","content":"Input52 1 1 0 0OutputYES3 52 41 31 2Input73 2 2 0 0 0 0OutputNOInput10OutputYESInput31 0 0OutputYES1 3"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of players.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a non-increasing sequence of non-negative integers, where $ a_i $ is the number of kills made by player $ i $.  \n\n**Constraints**  \n1. $ 1 \\leq n \\leq 200000 $  \n2. $ 0 \\leq a_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $  \n3. $ a_1 \\geq a_2 \\geq \\dots \\geq a_n $  \n\n**Objective**  \nDetermine whether there exists a valid sequence of kills (a chronological log) such that:  \n- Each kill is an ordered pair $ (x, y) $, where player $ x $ kills player $ y $, and $ x \\ne y $.  \n- No player can kill after being killed.  \n- At the end of the round, exactly one player remains alive (all others are dead).  \n- The total number of kills by player $ i $ is exactly $ a_i $.  \n\nIf such a sequence exists, output \"YES\" followed by any valid log of $ k = \\sum_{i=1}^n a_i $ kills.  \nOtherwise, output \"NO\".","simple_statement":"You are given n players and a list of kill counts in non-increasing order.  \nCheck if it’s possible for these kill counts to happen in a “Last Man Standing” game round, where players die and don’t respawn.  \nIf possible, output “YES” and any valid sequence of kills (killer → victim).  \nIf not, output “NO”.","has_page_source":false}