Triomino
A triomino is a connected shape made up of three squares. There are only two distinct types of such shapes, as shown in the picture. All others are simply rotations of these two. A rectangular field with m rows and n columns is considered filled with triominoes if:
Each triomino is entirely within the field and covers exactly three cells.
Triominoes do not overlap.
There are no more than two empty (uncovered by a triomino) cells.
A field filled with triominoes can be represented as a rectangular table. The value 0 indicates an unfilled cell. Identical natural numbers indicate that the cells belong to the same triomino, while different numbers indicate different triominoes.
Write a program that, after analyzing the contents of several numerical two-dimensional tables, determines for each whether it represents a correctly filled rectangular field with triominoes.
Input
The first line contains the number of rectangular tables t (2 ≤ t ≤ 10). Then there are t blocks of the following structure. The first line of a block contains two integers m and n (1 ≤ m ≤ 200, 1 ≤ n ≤ 200) - the number of rows and the number of columns of the corresponding table. Then there are m rows with n integers in each. The values of these numbers range from 0 to [m×n/3] inclusive. The size of the input data does not exceed 512 Kb.
Output
Output t lines, each containing the word YES or the word NO (in uppercase Latin letters) indicating whether the corresponding table represents a correctly filled rectangular field with triominoes.
Note: Picture for the first block: