Pulkit is really good at maths. Recently, he came to know about a problem on matrices. Amazed by the problem he got, he asked Ashish the same problem. Ashish also being good at maths solved the problem within 5 minutes. Now, its your time to solve the problem.

You will be given n*m binary matrix. You need to tell if it is possible to delete a column such that after deleting that column, rows of the matrix will be unique. If yes than print "Yes" else print "No". 

[Input]
First line contains an integer t denoting no.of test cases. 
Next line contains 2 integers n and m denoting no.of rows and columns.
Next n line contains binary string of length m each.

[Output]
For each test case output "Yes" or "No".

[Constraints]
1 ≤ t ≤ 100
1 ≤ n ≤ 1000
2 ≤ m ≤ 1000

SAMPLE INPUT
2
3 3
101
000
100
2 2
11
11

SAMPLE OUTPUT
Yes
No
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''

num_cases = int(raw_input().rstrip("\n"))
for count in range(num_cases):
    n, m = map(int, raw_input().rstrip("\n").split(" "))
    rows = []
    cet = set()
    for itr in range(n):
        row = raw_input().rstrip("\n")
        rows.append(row)
        cet.add(row)
    if len(cet) == n:
        found = False
        for i in range(m):
            det = set()
            for row in rows:
                s = row[0:i] + row[i+1:len(row)]
                det.add(s)
            if len(det) == n:
                found = True
                break
        if found:
            print "Yes"
        else:
            print "No"
    else:
        print "No"