atcoder#AGC008D. [AGC008D] K-th K
[AGC008D] K-th K
Score : points
Problem Statement
You are given an integer sequence of length . Determine if there exists an integer sequence that satisfies all of the following conditions, and if it exists, construct an instance of .
- is in length, containing copies of each of the integers , , , .
- For each , the -th occurrence of the integer from the left in is the -th element of from the left.
Constraints
- All are distinct.
Input
The input is given from Standard Input in the following format:
Output
If there does not exist an integer sequence that satisfies all the conditions, print No
.
If there does exist such an sequence , print Yes
in the first line, then print an instance of in the second line, with spaces inbetween.
3
1 5 9
Yes
1 1 1 2 2 2 3 3 3
For example, the second occurrence of the integer from the left in in the output is the fifth element of from the left. Similarly, the condition is satisfied for the integers and .
2
4 1
No