Dr. Henri is trying to create a particular circuit. This circuit forms the edges of an by grid of cells so that a resistor lies across each edge of the grid, except for the rightmost edge which is a power source. For example, when , the schematic is:
He already has his power source ready. Now, he must construct the rest of the circuit.
Dr. Henri uses resistor chains. A resistor chain of length is a chain of resistors. A chain of length is simply a single resistor. He can bend a chain between its resistors, but he cannot split a chain. Dr. Henri has resistor chains of length and would like to use all of them in his circuit, so that there are no overlaps. For example, if and the lengths are , he can construct his circuit like so:
Can you help Dr. Henri build his circuit?
Constraints
for all
Subtask 1 [10%]
Subtask 2 [20%]
Subtask 3 [30%]
Subtask 4 [40%]
Input Specification
The first line contains two space-separated integers, and .
The next line contains space-separated integers, .
Output Specification
On a single line, output yes
if Dr. Henri can build it given his chains and no
otherwise.
If he can build it, output 3 following lines, each with integers. The first line represents the top row of edges in the circuit, the second line represents the middle row (not including the power source), and the third line represents the bottom row. The integer denotes which chain is being used for that edge. The chains are labelled based on their order in the input (from to ).
Sample Input 1
2 3
4 1 1
Sample Output 1
yes
1 2
1 1
1 3
Explanation for Sample 1
Sample Input 2
2 4
4 1 1 1
Sample Output 2
no
Explanation for Sample 2
Dr. Henri can make his circuit with the first three chains, but he wants to use all four.
Sample Input 3
3 4
3 2 3 1
Sample Output 3
yes
1 1 3
1 2 3
2 3 4
Comments