Mario's Matrix

4

12 votes
Easy
Problem

Takla is very good at Maths and loves to play Mario game because he can play Mario only. One day while playing Mario, an interesting matrix problem came to his mind. Amazed by the problem he got, he asked Arun the same problem. Arun also being hero at Maths solved the problem in few seconds and now its your turn to solve it.
You will be given a n*m matrix which can have elements 0 or 1 only. You have to tell whether it is possible or not to delete a column from given matrix such that after deleting the column, the resulting matrix have all rows different (no two rows should be identical). If yes than print "Yes" else print "No".

Input
First you will be given a number t denoting the number of test cases. Then for each test-case, you are given two numbers n and m denoting the no. of rows and no. of columns respectively. In next n line, you will be given a binary string, each denoting a row of matrix.

Output
For each test case, print a line saying "Yes" or "No" .


Constraints:
1<=t<=100
1<=n<=1000
2<=m<=1000

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?