N, M = list(map(int, input().split()))

A_list = []

B_list = []

for _ in range(N):

    A_list.append(list(eval(input())))

for _ in range(M):

    B_list.append(list(eval(input())))

    



whole_flag = 0

for i in range(N-M+1):

    for j in range(N-M+1):

        flag = 0

        for k in range(M):

            if B_list[k] == A_list[i+k][j:j+M]:

                flag += 1

            else:

                pass

        if flag == M:

            whole_flag += 1

            

if whole_flag == 0:

    print("No")

else:

    print("Yes")
N, M = list(map(int, input().split()))

A_list=[eval(input())for i in range(N)]

B_list=[eval(input())for i in range(M)]



whole_flag = 0

for i in range(N-M+1):

    for j in range(N-M+1):

        flag = 0

        for k in range(M):

            if B_list[k] == A_list[i+k][j:j+M]:

                flag += 1

            else:

                pass

        if flag == M:

            whole_flag += 1

            

print(("Yes" if whole_flag >0 else "No"))
N, M = list(map(int, input().split()))
A_list = []
B_list = []
for _ in range(N):
    A_list.append(list(eval(input())))
for _ in range(M):
    B_list.append(list(eval(input())))
whole_flag = 0
for i in range(N - M + 1):
    for j in range(N - M + 1):
        flag = 0
        for k in range(M):
            if B_list[k] == A_list[i + k][j : j + M]:
                flag += 1
            else:
                pass
        if flag == M:
            whole_flag += 1
if whole_flag == 0:
    print("No")
else:
    print("Yes")

N, M = list(map(int, input().split()))
A_list = [eval(input()) for i in range(N)]
B_list = [eval(input()) for i in range(M)]
whole_flag = 0
for i in range(N - M + 1):
    for j in range(N - M + 1):
        flag = 0
        for k in range(M):
            if B_list[k] == A_list[i + k][j : j + M]:
                flag += 1
            else:
                pass
        if flag == M:
            whole_flag += 1
print(("Yes" if whole_flag > 0 else "No"))

-A_list = [] -B_list = [] -for _ in range(N): -    A_list.append(list(eval(input()))) -for _ in range(M): -    B_list.append(list(eval(input()))) +A_list = [eval(input()) for i in range(N)] +B_list = [eval(input()) for i in range(M)] -if whole_flag == 0: -    print("No") -else: -    print("Yes") +print(("Yes" if whole_flag > 0 else "No"))