C. Mr. Mime's Puzzle
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Mr. Mime enjoys walking around town playing tricks on townspeople. In particular, Mr. Mime likes to trap unassuming individuals using invisible walls, forcing them to solve a puzzle for their freedom.

Today, Mr. Mime has trapped you and starts shuffling the air, throwing it at you until suddenly you're able to see a deck of cards being dealt out to a table in front of you! Looks like this deck of cards is your puzzle for the day. It seems to be a $$$52$$$ card deck with $$$4$$$ suits ($$$H$$$, $$$S$$$, $$$D$$$, $$$C$$$) and $$$13$$$ numbered cards for each suit (numbered $$$1$$$ through $$$13$$$). However, some cards are missing its suit, some cards are missing its number, and the rest are missing both. You see that there are $$$N$$$ cards that are missing its suit but not its number and $$$M$$$ cards that are missing its number but not its suit ($$$1 \leq N, M \lt 52$$$, $$$N + M \leq 52$$$). There isn't a single card that is complete with both a suit and number.

As you stare at these cards, Mr. Mime points at the deck and gives you a strange look. It seems that in order to be free, you must determine whether or not this deck is actually a valid $$$52$$$ card deck if you assign missing suits and numbers to all the cards. A valid $$$52$$$ card deck contains all $$$13$$$ unique numbers for each suit. Good luck solving Mr. Mime's puzzle!

Input

The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follow.

The first line of each test case consists of two integers $$$N$$$ and $$$M$$$ ($$$1 \leq N, M \lt 52$$$, $$$N + M \leq 52$$$), the number of cards that are either missing its suit or number but not both, respectively.

The second line of each test case consists of $$$N$$$ space-separated integers, providing the number of a card that doesn't have its suit (from $$$1$$$ to $$$13$$$).

The third line of each test case consists of $$$M$$$ space-separated characters, providing the suit of a card that doesn't have its number (either $$$H$$$, $$$S$$$, $$$D$$$, or $$$C$$$).

Output

For each test case, output "YES" if the cards provided are a valid deck. Otherwise, output "NO". You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

Example
Input
5
3 4
1 2 3
H S D C
5 2
1 1 1 1 1
S D
12 12
1 1 1 1 2 2 2 2 3 4 5 6
H H H H H H H H H H H H
12 11
1 1 1 1 2 2 2 2 3 4 5 6
H H H H H H H H H H H
17 19
1 1 1 2 2 3 3 3 3 4 4 4 4 5 5 5 5
H H H H H H H H H S S S S S S S S S H
Output
YES
NO
NO
YES
YES
Note

In the first test case, a possible assignment of the cards is $$$(1, H)$$$, $$$(2, H)$$$, $$$(3, H)$$$ for the cards that don't have its suit and $$$(5, H), (6, S), (7, D), (8, C)$$$ for the cards that don't have its number. The remaining cards (missing both suit and number) can be assigned to fill up the remaining $$$45$$$ cards to form a valid deck.

In the second test case, it's not possible for there to be $$$5$$$ cards that have number $$$1$$$. There can only be $$$4$$$ cards with the same number for each suit, so it is not possible to form a valid deck.