import numpy as np



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

A = np.array([list(eval(input())) for _ in range(N)])

B = np.array([list(eval(input())) for _ in range(M)])



bl = False

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

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

    if (A[i:i+M,j:j+M] == B).all():

      bl = True



answer = 'Yes' if bl else 'No'

print(answer)

import numpy as np



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

A = np.array([list(eval(input())) for i in range(N)])

B = np.array([list(eval(input())) for i in range(M)])

f = False



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

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

    if (A[i:i+M,j:j+M]==B).all():

      f = True



if f:

  print("Yes")

else:

  print("No")

import numpy as np

N, M = list(map(int, input().split()))
A = np.array([list(eval(input())) for _ in range(N)])
B = np.array([list(eval(input())) for _ in range(M)])
bl = False
for i in range(N - M + 1):
    for j in range(N - M + 1):
        if (A[i : i + M, j : j + M] == B).all():
            bl = True
answer = "Yes" if bl else "No"
print(answer)

import numpy as np

N, M = list(map(int, input().split()))
A = np.array([list(eval(input())) for i in range(N)])
B = np.array([list(eval(input())) for i in range(M)])
f = False
for i in range(N - M + 1):
    for j in range(N - M + 1):
        if (A[i : i + M, j : j + M] == B).all():
            f = True
if f:
    print("Yes")
else:
    print("No")

-A = np.array([list(eval(input())) for _ in range(N)]) -B = np.array([list(eval(input())) for _ in range(M)]) -bl = False +A = np.array([list(eval(input())) for i in range(N)]) +B = np.array([list(eval(input())) for i in range(M)]) +f = False -            bl = True -answer = "Yes" if bl else "No" -print(answer) +            f = True +if f: +    print("Yes") +else: +    print("No")