Surely you have seen insane videos of South Korean rapper PSY, such as 
“Gangnam Style”, “Gentleman” and “Daddy”. But you are unlikely to 
know that right now PSY records new video “Oppa Funcan Style”! 
It happens like this: on the ground there are n platforms, which are 
numbered with integers from 1 to n, on i-th platform there is a 
dancer with number i. Further, every second all the dancers, standing on 
the platform with number i, jump to the platform with a number f(i). 
The moving rule f is selected in advance and is not changed throughout 
the clip.  
The duration of the clip is k seconds, but PSY wants more! If after k 
seconds all dancers will be in their initial positions (i.e. i-th dancer 
will stand on the platform with the number i), then the clip can be 
looped and collect even more “likes”. 
Some values of f(i) has been already determined due to the technical 
limitations, but other values can be any one (except that the platform 
with such number must exist). 
Help PSY to blow up the Internet once again, choosing indefinite values of 
f(i) in such a way that through k seconds all dancers will return to 
their initial positions. 
Input
The first line contains integers n and k that are the number of 
dancers in the clip and the duration of the clip in seconds (1 ≤ n ≤ 
35; 1 ≤ k ≤ 109).
The second line contains n integers f(i) determining the moving rule 
for the platforms with numbers from 1 to n (0 ≤ f(i) ≤ n). If 
f(i) = 0, then the rule for the platform i is indefinite.
Output
Output “Yes” in the first line if you can choose suitable indefinite 
values of f(i); otherwise output “No”. In the first case output the 
required function in the second line in the same format as in the input 
(but now all values must be defined). If the problem has several 
solutions, output any of them.
Samples
| input | output | 
|---|
| 3 4
1 2 3
 | Yes
1 2 3 
 | 
| 3 4
0 0 0
 | Yes
1 2 3 
 | 
| 3 1
2 2 2
 | No
 | 
| 2 666
2 0
 | Yes
2 1 
 | 
| 2 777
2 0
 | No
 | 
Problem Author: Alexey Danilyuk
Problem Source: Ural FU Junior Championship 2016