Note: For Turbo C++, select "Text" as your language
 
Problem Description:
In IIIT we use password system to unlock the lab doors and only Mtech students are given the password for these labs. Password system comprises of n*n keypad where n is odd.
One day Ashish saw an Mtech student using the password. He figured out that the password is symmetric about the centre point ( centre point for n*n keypad will be point with co-ordinates (n/2, n/2) according to 0 based indexing or (n/2+1, n/2+1) according to 1 based indexing). Now he has to try all possible symmetric combinations to unlock the door. Since he has not enough time he asks you to tell if given password is symmetric or not.
You will be given n*n binary grid containing elements as 0 if that key is not used and 1 if that key is used. You need to tell whether the given binary grid is symmetric according to the centre point.
 

Input
First line contains an integer t denoting number of test cases.
Each test case begin with an integer n denoting the size of the grid.
Next n line contains n space separated integers. Each integer is 1 or 0 depending on if that button is pressed for that password or not.
 

Output
For each test case output single line containing “Yes” or “No” depending on whether the given password is symmetric or not.
 

Constraints

1 ≤ T ≤ 10
1 ≤ n ≤ 100

 

Example
Input:
3
3
1 1 0
0 0 0
0 1 1
3
1 1 0
0 0 0
1 1 0
3
1 0 1
1 0 0
0 0 0

Output:
Yes
No
No
 

Explanation
Example case 1. Since the given password is symmetric along centre point so ans is Yes.
Example case 2. Since the given password is not symmetric along centre point so ans is No.
n=input()
d=[]
for i in range(n):
    v=[]
    s=input()
    for i in range(s):
        c=[]
        b=''
        b=raw_input()
        for i in b.split():
            c.append(int(i))
        v.append(list(c))
    d.append(v)
w=[]
for i in range(len(d)):
    if d[i][len(d[i])/2][0]==d[i][len(d[i])/2][-1]:
        if d[i][0]==d[i][-1][::-1]:
            w.append('Yes')
        else:
            w.append('No')
    else:
        w.append('No')
for i in w:
    print i