n, m = map(int, input().split())
A = []
B = []
for i in range(n):
    a = list(input())
    A.append(a)
for i in range(m):
    b = list(input())
    B.append(b)

for i in range(n - m + 1):
    for j in range(n - m + 1):
        ok = True
        for h in range(m):
            if not ok:
                break
            for w in range(m):
                # print(A[i + h][j + w])
                if A[i + h][j + w] != B[h][w]:
                    ok = False
                    break
        if ok:
            print("Yes")
            exit()
print("No")
06f124c14598b1e8b8133aa1030faf99e4ff3ca9
<mask token>

<mask token>
for i in range(n):
    a = list(input())
    A.append(a)
for i in range(m):
    b = list(input())
    B.append(b)
for i in range(n - m + 1):
    for j in range(n - m + 1):
        ok = True
        for h in range(m):
            if not ok:
                break
            for w in range(m):
                if A[i + h][j + w] != B[h][w]:
                    ok = False
                    break
        if ok:
            print('Yes')
            exit()
print('No')

n, m = map(int, input().split())
A = []
B = []
for i in range(n):
    a = list(input())
    A.append(a)
for i in range(m):
    b = list(input())
    B.append(b)
for i in range(n - m + 1):
    for j in range(n - m + 1):
        ok = True
        for h in range(m):
            if not ok:
                break
            for w in range(m):
                if A[i + h][j + w] != B[h][w]:
                    ok = False
                    break
        if ok:
            print('Yes')
            exit()
print('No')

n, m = map(int, input().split())
A = []
B = []
for i in range(n):
    a = list(input())
    A.append(a)
for i in range(m):
    b = list(input())
    B.append(b)

for i in range(n - m + 1):
    for j in range(n - m + 1):
        ok = True
        for h in range(m):
            if not ok:
                break
            for w in range(m):
                # print(A[i + h][j + w])
                if A[i + h][j + w] != B[h][w]:
                    ok = False
                    break
        if ok:
            print("Yes")
            exit()
print("No")