PROGRAMMING:Rainbow bottle
The production process of rainbow bottles is (not) like this: first, a large number of empty bottles are laid on the filling site, and then the small balls of each color are evenly scattered into the batch of bottles in a certain order.
Suppose that the rainbow bottle should be filled with N kinds of color balls in order (the order may be numbered as 1 to n). Now there are boxes of balls of each color in the factory. Workers need to move the balls from the factory to the loading site box by box. If the box of balls is just the color that can be filled, it can be directly unpacked and filled; If not, stack the boxes on a temporary shelf. The way to stack them is to pile them up one by one. When one color is filled, first check whether the box at the top of the shelf is the next color to be filled. If it is, take it down for filling. Otherwise, go to the factory and move another box.
If the order of delivery in the factory is better, the workers can complete the loading smoothly. For example, if 7 colors are to be filled in order and the factory delivers the goods in the order of 7, 6, 1, 3, 2, 5 and 4, the workers will first get 7 and 6 colors that cannot be filled and pile them on the shelves in the order of 7 on the bottom and 6 on the top; When you get 1, you can load it directly; When you get 3, you have to put it on color box 6 temporarily; When you get 2, you can load it directly; Then take down 3 pieces from the top of the shelf for loading; Then get 5 and put the temporary code on 6; Finally, No.4 color was used for direct loading; The rest of the work is to remove 5, 6, 7 from the shelf in order to load.
However, if the factory delivers the goods in the order of 3, 1, 5, 4, 2, 6 and 7, the workers will have to toss the shelves angrily, because after filling in the No. 2 color, if they don't move down the boxes on the shelves, they won't get the No. 3 box, and they won't be able to complete the task smoothly.
In addition, the capacity of the shelf is limited, if the goods to be piled up exceed the capacity, the workers can not successfully complete the task. For example, the factory delivers goods in the order of 7, 6, 5, 4, 3, 2 and 1. If the shelf is high enough to stack 6 boxes, it can be completed smoothly; But if the shelves can only stack five boxes, the workers will be angry again
Please judge whether the delivery order of the factory can make the workers complete the task smoothly.
###Input format:
Input first, give three positive integers in the first line, which are the color quantity of rainbow bottles $$n $$($$1 < n < Le 10 ^ 3 $$), the capacity of temporary shelves $$M $$($$< n $$), and the quantity of delivery order to be judged $$k $$.
The next $$k $$line, each line gives $$n $$numbers, which is an arrangement from 1 to $$n $, corresponding to the delivery order of the factory.
Numbers in a row are separated by spaces.
###Output format:
For each delivery order, if the workers can finish the work happily, output 'yes' in one line; Otherwise, output ` no '.
###Input example:
```in
7 5 3
7 6 1 3 2 5 4
3 1 5 4 2 6 7
7 6 5 4 3 2 1
```
###Output example:
```out
YES
NO
NO
```
answer:If there is no answer, please comment