Time limit per test: 0.25 second(s) Memory limit: 65536 kilobytes
input: standard output: standard
Aof order n is a linear order of 2n objects satisfying the following conditions:
For each i such that 1≤ i≤ n holds
For each i and j such that 1≤ i,j≤ n holds .
Let
(bii is undefined). Let a(i) be the number of such j that . You are given integers a1,a2,..., an. You have to find any bipermutation such that a(i)=ai for all i.
Input
The first line of the input contains single integer n (1≤ n≤ 1000). The next line contains the numbers a1,...,an.
Output
If there is no solution, the only line of the output must contain single word 'NO' (without quotes). Otherwise the first line of the output must contain single word 'YES' (without quotes); the rest of the output must contain the objects ordered with respect to the bipermutation ( is output as -i).