You are given a sequence of length and a sequence of length .
Sequence is a permutation: each of the integers appears exactly once. Every element of is between and , inclusive, and its elements are all distinct.
Let be the sequence to which you apply operations. Initially, equals . You may perform either of the following operations any number of times, including zero times.
Determine whether the operations can make equal to . If possible, find any sequence of operations that does so.
You do not need to minimize the number of operations.
The first line contains two integers and , in that order, separated by a space.
The next line contains space-separated integers in that order.
If cannot be transformed into , print NO on the first line.
Otherwise, print YES on the first line.
On the next line, print the number of operations. It must satisfy:
Sequence changes as follows.
The next line contains space-separated integers in that order.
On the next lines, print the operations in order. Each operation has one of the following two formats.
1 . Swap the -th and -th elements of . If is the length of immediately before the operation, must hold and the value of the -th element must be less than that of the -th element.2 . Merge the -th and -th elements of . If is the length of immediately before the operation, must hold.All positions refer to immediately before the corresponding operation. The first position is numbered .
After all printed operations are performed in order, the resulting sequence must be exactly .
If more than one output is valid, any one is accepted.
It can be shown that if can be transformed into using the given operations, there is an output satisfying all the conditions above.
| 4 | 10 | for every integer (). |
| 5 | 13 |
| 6 | 15 | Sequence is a subsequence of . That is, there are integers such that and for every integer (). |
| 7 | 30 |
| 8 | 5 | No additional constraints. |
Thus can be transformed into .