#arc159c. [arc159_c]Permutation Addition
[arc159_c]Permutation Addition
Problem Statement
You are given a sequence of positive integers: .
Determine whether it is possible to make all elements of equal by repeating the following operation between and times, inclusive. If it is possible, show one way to do so.
- Choose a permutation of , and replace with .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
If it is impossible to make all elements of equal, print No
.
If it is possible, print one way to do so in the following format, where is the number of operations, and is the permutation chosen in the -th operation:
Yes
If multiple solutions exist, you may print any of them.
Sample Input 1
2
15 9
Sample Output 1
Yes
8
1 2
1 2
1 2
1 2
2 1
1 2
1 2
1 2
This sequence of operations makes , where all elements are equal.
Sample Input 2
5
1 2 3 10 10
Sample Output 2
No
Sample Input 3
4
1 1 1 1
Sample Output 3
Yes
0
All elements of are equal from the beginning.