Winning Rewards
Several towns from the northern region of Brazil have entered a competition to win rewards. To participate, each town sent their most proficient programmer to compete in a coding competition.
After the competition, the leaderboard was published containing the score of each of the competitors. Now you need to assist in the allocation of the rewards.
There are competitors, and exactly rewards must be allocated.
The rewards must be allocated according to the leaderboard. Every competitor should receive at least one reward. If two or more competitors had the same score, they should both receive the same number of rewards. And for every pair of competitors that have different scores, the one who scored higher should receive more rewards than the other.
Now we need your help. Given the competition leaderboard, and the exact number of rewards to be allocated, find out how many rewards each competitor should receive, or say that this is not possible. If there is more than one solution, print any of them.
Input
The first line of the input contains two integers and , indicating that there are competitors and rewards .
Next there will be a line with integers , indicating how many points the -th competitor made.
Output
If it is not possible to distribute the rewards in a way that respects the restrictions, print a line containing the word "nao" (Portuguese word to 'no').
If it is possible to distribute the rewards, print a line containing the word "sim" (Portuguese word to 'yes'), and on the next line print integers , indicating how many rewards the -th competitor should receive.
If there is more than one solution, print any of them.
Restrictions
Input Samples | Output Samples |
---|---|
3 10
10 30 50 |
sim
2 3 5 |
4 10
5 2 10 2 |
sim
2 1 6 1 |
5 10
5 4 3 2 1 |
nao
|