Let us consider an array of size n \times m filled with pairwise different integers. The following operations are allowed on the array:
Interchanging two rows,
Interchanging two columns.
We call two arrays alike if one of them can be obtained from the other by a sequence of the above two operations. Write a program that for a given set of pairs of arrays tells which pairs are alike.
The first line of the standard input contains an integer (1 \le t \le 10) denoting the number of test cases which represent the number of pairs of arrays. The first line of each test case holds two integers and (1 \le n \le 1000 and 1 \le m \le 1000), separated by a single space. and denote the number of rows and columns of the arrays, respectively. The next lines represent rows of the first array and the following lines represent rows of the second array. Each line holds array items where each value is between and inclusive. All numbers occurring in either of the arrays are pairwise different.
Your program should print out lines to the standard output. The -th of these should hold one word: "YES" if the arrays of the -th pair are alike, or "NO" otherwise (in capital letter only).
Example 1