Professor Toving Liles of the computer science department likes the floor tiles in his office so much that he wants to protect them from careless students. He plans to buy cheap small rectangular carpets at the supermarket and cover the floor so that all four rules hold:
Every carpet is laid with its sides parallel to the walls, and the professor does not have to buy the whole stock. Decide whether he can carry out his plan.
The first line contains two integers W and H, the width and the height of the room (1≤W,H≤100).
The second line contains an integer c, the number of carpet colors the supermarket has in stock (1≤c≤7).
Each of the following c lines contains three integers ai, wi and hi, meaning that the supermarket has ai carpets of size wi×hi in color i (1≤ai≤7; 1≤wi≤100; 1≤hi≤100).
The supermarket has at most 7 carpets in total, that is ∑iai≤7.
Print yes if the room can be covered under the rules above, and no otherwise.