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

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

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



ans = 'No'



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

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

        check = 0

        for ind, s in enumerate(B):

            #print(s)

            #print(A[i + ind][j])

            if s != A[i + ind][j: j+M]:



                check = 1

        if check == 0:

            ans = 'Yes'



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

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

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

check = 0



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

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

        bb = []

        for k in range(M):

            bb.append(A[i + k][j:j+M])

        if bb == B:

            check = 1



if check == 1:

    print('Yes')

else:

    print('No')
N, M = list(map(int, input().split()))
A = [eval(input()) for i in range(N)]
B = [eval(input()) for i in range(M)]
ans = "No"
for i in range(N - M + 1):
    for j in range(N - M + 1):
        check = 0
        for ind, s in enumerate(B):
            # print(s)
            # print(A[i + ind][j])
            if s != A[i + ind][j : j + M]:
                check = 1
        if check == 0:
            ans = "Yes"
print(ans)

N, M = list(map(int, input().split()))
A = [eval(input()) for i in range(N)]
B = [eval(input()) for i in range(M)]
check = 0
for i in range(N - M + 1):
    for j in range(N - M + 1):
        bb = []
        for k in range(M):
            bb.append(A[i + k][j : j + M])
        if bb == B:
            check = 1
if check == 1:
    print("Yes")
else:
    print("No")

-ans = "No" +check = 0 -        check = 0 -        for ind, s in enumerate(B): -            # print(s) -            # print(A[i + ind][j]) -            if s != A[i + ind][j : j + M]: -                check = 1 -        if check == 0: -            ans = "Yes" -print(ans) +        bb = [] +        for k in range(M): +            bb.append(A[i + k][j : j + M]) +        if bb == B: +            check = 1 +if check == 1: +    print("Yes") +else: +    print("No")