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 n in range(N)])

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

a = "No"



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

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

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

      a = "Yes"



print(a)
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 n in range(N)])
B = np.array([list(eval(input())) for m in range(M)])
a = "No"
for i in range(N - M + 1):
    for j in range(N - M + 1):
        if (A[i : i + M, j : j + M] == B).all():
            a = "Yes"
print(a)

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