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

A = [''] * N

B = [''] * M

for i in range(N):

    A[i] = eval(input())

for i in range(M):

    B[i] = eval(input())



match_cnt = 0

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

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

        flag = True

        for y in range(M):

            for x in range(M):

                if A[y + i][x + j] != B[y][x]:

                    flag = False

        if flag:

            match_cnt += 1



if match_cnt > 0:

    print('Yes')

else:

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

A = [''] * N

B = [''] * M

for i in range(N):

    A[i] = eval(input())

for i in range(M):

    B[i] = eval(input())



match_cnt = 0

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

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

        flag = True

        for y in range(M):

            if A[y + i][j:j + M] != B[y]:

                flag = False

        if flag:

            match_cnt += 1



if match_cnt > 0:

    print('Yes')

else:

    print('No')
N, M = list(map(int, input().split()))
A = [""] * N
B = [""] * M
for i in range(N):
    A[i] = eval(input())
for i in range(M):
    B[i] = eval(input())
match_cnt = 0
for i in range(N - M + 1):
    for j in range(N - M + 1):
        flag = True
        for y in range(M):
            for x in range(M):
                if A[y + i][x + j] != B[y][x]:
                    flag = False
        if flag:
            match_cnt += 1
if match_cnt > 0:
    print("Yes")
else:
    print("No")

N, M = list(map(int, input().split()))
A = [""] * N
B = [""] * M
for i in range(N):
    A[i] = eval(input())
for i in range(M):
    B[i] = eval(input())
match_cnt = 0
for i in range(N - M + 1):
    for j in range(N - M + 1):
        flag = True
        for y in range(M):
            if A[y + i][j : j + M] != B[y]:
                flag = False
        if flag:
            match_cnt += 1
if match_cnt > 0:
    print("Yes")
else:
    print("No")

-            for x in range(M): -                if A[y + i][x + j] != B[y][x]: -                    flag = False +            if A[y + i][j : j + M] != B[y]: +                flag = False