Time limit per test: 2 seconds Memory limit: 64 megabytes
input: standard output: standard
A of order is a linear order of objects satisfying the following conditions:
For each such that holds
For each and such that holds .
Let
( is undefined). Let be the number of such that . You are given integers . You have to find any bipermutation such that for all .
Input
The first line of the input contains single integer (). The next line contains the numbers .
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 ).