#arc122e. [arc122_e]Increasing LCMs
[arc122_e]Increasing LCMs
Problem Statement
We have a sequence of positive integers: . You are to rearrange these integers into another sequence , where must satisfy the following condition:
- Let us define , where the function returns the least common multiple of the given integers. Then, is strictly increasing. In other words, holds.
Determine whether it is possible to form a sequence satisfying the condition, and show one such sequence if it is possible.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If it is possible to form a sequence satisfying the condition, print your answer in the following format:
Yes
If it is impossible, print No
.
Sample Input 1
3
3 4 6
Sample Output 1
Yes
3 6 4
For , we have:
Here, holds.
Sample Input 2
3
2 3 6
Sample Output 2
No
No permutation of would satisfy the condition.
Sample Input 3
10
922513 346046618969 3247317977078471 4638516664311857 18332844097865861 81706734998806133 116282391418772039 134115264093375553 156087536381939527 255595307440611247
Sample Output 3
Yes
922513 346046618969 116282391418772039 81706734998806133 255595307440611247 156087536381939527 134115264093375553 18332844097865861 3247317977078471 4638516664311857