In programming contests, a common problem for the contestants is to get a suited T-shirt. Sometimes people gets too long or too short T-shirts. So, this time I have planned to ask the authority to manage the T-shirts such that everyone gets a suitable one. From my past experience, it's known that there are 6 available sizes of T-shirts and they are XXL, XL, L, M, S, and XS. And exactly two sizes of the T-shirts suit a person.
Now, for a contest there are T-shirts of N colors and M contestants. And for each color, all the 6 sizes are available. So, there are 6 * N T-shirts. And you are given the suitable sizes for each contestant. You have to distribute the T-shirts to the contestants such that everyone gets a suitable size. Only size matters, color is not an issue. Now you have to decide whether it's possible or not.
Input
Input starts with an integer T (≤ 50), denoting the number of test cases.
The first line of each test case contains two integers N and M, separated by spaces, with 1 ≤ N, M ≤ 50. Each of the next M lines will contain two sizes as described earlier.
Output
For each case, print the case number and "YES" or "NO" depending on whether it's possible to distribute the T-shirts or not.
Sample
Sample Input | Sample Output |
---|---|
3 3 6 L XL XL L XXL XL S XS M S M L 1 4 S XL L S L XL L XL 1 1 L M | Case 1: YES Case 2: NO Case 3: YES |