You control a swarm of $$$n$$$ robots, operating in an environment with $$$n$$$ locations. Initially, all robots are at different locations. You can program the robots, but due to a malfunction, all robots will execute the same program. To fix them, you want to gather all of them in the same location. Write a program which achieves this.
Your program consists of a list of subroutines, numbered $$$1 \dots m$$$. Subroutine $$$1$$$ is the main program. Each subroutine is a sequence of primitive instructions and calls to other subroutines.
There are $$$k$$$ primitive instructions, numbered $$$1 \dots k$$$. The effect of a primitive instruction depends on the current location of the robot. You are given, for each primitive instruction and each location, the new location after executing the instruction.
The first line contains two integers $$$n$$$, $$$k$$$ ($$$1 \leq n \leq 300$$$, $$$1 \leq k \leq 200$$$).
The following description of a primitive instruction is repeated on the next $$$k$$$ lines. One line with $$$n$$$ integers $$$s_i$$$ ($$$1 \leq s_i \leq n$$$), the new location if the primitive instruction is executed at location $$$i$$$.
If no such program exists, output one line containing NO.
Otherwise, on the first line, output YES.
On the next line, output one integer $$$m$$$ ($$$1 \leq m \leq 2 \cdot 10^5$$$), the number of subroutines you will use.
Following this output $$$m$$$ lines, the definitions of your subroutines: Output one integer $$$l_i$$$ ($$$0 \leq l_i \leq 2 \cdot 10^5$$$), followed by $$$l_i$$$ integers $$$v_1, \dots v_{l_i}$$$ ($$$-k \leq v_i \leq m, v_i \neq 0$$$). These are the commands of the subroutine:
You have to guarantee that $$$\sum l_i \leq 2 \cdot 10^5$$$.
Subroutine $$$1$$$ will then be invoked on all robots. You have to guarantee that this will terminate and execute no more than $$$10^8$$$ primitive instructions.
It can be shown that if a solution exists, there is also a solution satisfying these constraints.
6 11 1 2 1 4 4
YES 1 2 -1 -1
3 22 3 13 1 2
NO
4 22 1 1 31 4 4 3
YES 3 3 2 3 2 2 -1 -1 1 -2
We will explain the third sample. The two primitive instructions given are:
It can be checked that the sequence $$$(1,1,2,1,1)$$$ corresponding to first taking two moves in the first graph, then one move in the second graph, and then once again two moves in the first graph, is a valid solution. This is also the sequence of instructions executed by the program in the solution.
| Name |
|---|


