Description KiKi has two matrices with n rows and m columns. He wants to know whether the two matrices are equal. Two matrices are equal when their corresponding array elements are equal. Input description: The first line contains two integers n and m, indicating that two matrices contain n rows and m columns, separated by Spaces. The value ranges from 2 to N +1. Enter m integers (ranging from -231 to 231-1) in each line, separated by Spaces. A total of N x M numbers are entered to indicate the elements in the first matrix. From n+2 to 2n+1, enter m integers (ranging from -231 to 231-1) in each row, separated by Spaces. A total of N x M numbers are entered to represent the elements in the second matrix. 1 < n,m < 10 Output description: one line, if two matrices are equal print "Yes" and wrap, otherwise print "No" and wrap.Copy the code

n,m=list(map(int,input().split(" ")))
# print(n,m)
m1=[]
for i in range(n):
    m1.append(input())
m2=[]
for i in range(n):
    m2.append(input())
if m1==m2:
    print("Yes\n")
else:
    print("No\n")
Copy the code