E. L-Covering Checker
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In this problem, you need to implement the output checker from the previous problem.

Given a grid with $$$n$$$ rows and $$$m$$$ columns, where rows are numbered from $$$1$$$ to $$$n$$$ from top to bottom, and columns are numbered from $$$1$$$ to $$$m$$$ from left to right. Now, there are infinite $$$1+1$$$ L-shaped tiles (as shown in the figure below), and you have used some tiles to cover the grid, but you do not know if you have covered the grid correctly.

Your covering scheme can be represented as a string of length $$$m$$$ for each of the $$$n$$$ rows. The string contains only the six characters UDLRC., where the $$$j$$$-th character of the $$$i$$$-th row represents the covering situation of the grid in the $$$i$$$-th row and the $$$j$$$-th column. The character . represents that the cell is not covered. If there is only one . in the covering scheme, and this . is located in the $$$1$$$-st row and the $$$m$$$-th column, then the covering scheme is correct; otherwise, it is incorrect. The character C represents the center of the tile (i.e., the bottom-left corner of the tile in the figure). The characters UDLR respectively represent that the top, bottom, left, right cell of this cell is covered by the center of the tile. If all L-shaped tiles are complete and each cell is covered by only one tile, then the covering scheme is correct; otherwise, it is incorrect.

Given some covering schemes, please determine if these schemes are correct.

Input

The first line contains an integer $$$T$$$ ($$$1\le T\le 10^4$$$), indicating the number of test cases.

For each test case, the first line contains two integers $$$n,m$$$ ($$$2\le n,m\le 500$$$), indicating the size of the grid.

Then, there are $$$n$$$ lines, each containing a string of length $$$m$$$, where the string consists of only the six characters UDLRC.. The $$$j$$$-th character of the $$$i$$$-th line string represents the covering situation of the cell in the $$$i$$$-th row and the $$$j$$$-th column of the grid.

It is guaranteed that the sum of all $$$n\times m$$$ for all test cases does not exceed $$$10^6$$$.

Output

For each test case, if the covering scheme is correct, output Yes; otherwise, output No.

Example
Input
2
4 4
CLD.
UDCL
DCLD
CLRC
2 3
DRC
CLU
Output
Yes
No