Serena has arranged for herself and her family members to come together for dinner at your restaurant! You have arranged the members of the family, which includes Serena herself, to sit around a circular table. Conveniently, the family members are numbered from to , and sit in such a way that the -th family member sits adjacent to the -th and -th family member. Having prepared well in advance, you know that the -th family member would like to be served a total of exactly dishes. Now, the task that remains is to serve the dishes to Serena's family. To do so, you send a waiter out every minute to serve one dish to exactly two adjacent members around the table.
Determine a sequence of operations to satisfy Serena's family, or gingerly tell them that it is not possible to do so.
Input Specification
The first line contains the integer , the size of Serena's family.
The next line contains integers , the number of dishes that are to be served to each family member.
Output Specification
If it is possible to satisfy Serena's family, output YES
on a single line. Then, output the integer , the time required in minutes, on a single line. Then, output lines, each containing two spaced-separated integers and (, adjacent to , ). The -th of these lines denotes that a waiter should serve the -th and the -th family member simultaneously on the -th minute.
Otherwise, output NO
on a single line.
Constraints
The sum of all does not exceed .
Sample Input 1
5
3 2 2 0 3
Sample Output 1
YES
5
0 4
4 0
1 2
1 2
4 0
Sample Input 2
3
1337 1337 1337
Sample Output 2
NO
Comments