| 9 | class XORFOLD |
| 10 | { |
| 11 | public static void main (String[] args) throws java.lang.Exception |
| 12 | { |
| 13 | Scanner sc = new Scanner(System.in); |
| 14 | int t = sc.nextInt(); |
| 15 | while(t--!=0) |
| 16 | { |
| 17 | int n=sc.nextInt(); |
| 18 | int m=sc.nextInt(); |
| 19 | String arr[]=new String[n]; |
| 20 | for(int i=0;i<n;i++) |
| 21 | { |
| 22 | arr[i]=sc.next();//Taking input of each row |
| 23 | } |
| 24 | int result=solve(arr,n,m);//calling the function |
| 25 | |
| 26 | if(result==1) |
| 27 | System.out.println("YES"); |
| 28 | else |
| 29 | System.out.println("NO"); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | static int solve(String[] arr,int len,int m) { |
| 34 | |