F. Half Mixed
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

Given two integers $$$n$$$ and $$$m$$$, you need to construct a matrix $$$M$$$ satisfying the following constraints:

  • The number of rows and columns of $$$M$$$ are $$$n$$$ and $$$m$$$ respectively.
  • The matrix contains only $$$0$$$s and $$$1$$$s, namely, $$$M_{i,j} \in \{0, 1\}$$$ for all $$$1 \le i \le n$$$ and $$$1\le j \le m$$$.
  • The number of mixed subrectangles equals to the number of pure subrectangles. The subrectangles that contain both $$$0$$$s and $$$1$$$s are considered as mixed subrectangles, otherwise pure subrectangles. Note that a subrectangle is an intersection of some consecutive rows and some consecutive columns.

If multiple solutions exist, print any one of them. If there is no solution, report it.

Input

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

For each test case, the only line contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n,m \le 10^6$$$, $$$1 \le n\times m \le 10^6$$$), denoting the number of rows and columns respectively.

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

Output

For each test case, if there is no solution, print "No" (without quotes) in one line. If the solution exists, print "Yes" (without quotes) in the first line. Then print $$$n$$$ lines, the $$$i$$$-th of which contains $$$m$$$ integers $$$M_{i,1}, M_{i,2}, \ldots, M_{i,m}$$$, describing the $$$i$$$-th row of the matrix.

Example
Input
2
2 3
1 1
Output
Yes
0 1 1
1 1 0
No
Note

In the first sample case, the number of mixed subrectangles and pure subrectangles are both $$$9$$$.

In the second sample case, the only subrectangle is the whole matrix that must be pure, so the number of mixed subrectangles and the number of pure subrectangles must be $$$0$$$ and $$$1$$$ respectively, which are not equal.