n,m = list(map(int,input().split()))

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

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

 

flag = False

for i in range(n-m+1):

    for j in range(n-m+1):

        flag = True

        for k in range(m):

            if B[k] != A[i+k][j:j+m]:

                flag = False

        if flag:

            print("Yes")

            exit()

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)]

 

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

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

    t = True

    for k in range(M):

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

        t = False

    if t:

      print("Yes")

      exit()

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)]
flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        flag = True
        for k in range(m):
            if B[k] != A[i + k][j : j + m]:
                flag = False
        if flag:
            print("Yes")
            exit()
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)]
for i in range(N - M + 1):
    for j in range(N - M + 1):
        t = True
        for k in range(M):
            if B[k] != A[i + k][j : j + M]:
                t = False
        if t:
            print("Yes")
            exit()
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)] -flag = False -for i in range(n - m + 1): -    for j in range(n - m + 1): -        flag = True -        for k in range(m): -            if B[k] != A[i + k][j : j + m]: -                flag = False -        if flag: +N, M = list(map(int, input().split())) +A = [eval(input()) for i in range(N)] +B = [eval(input()) for i in range(M)] +for i in range(N - M + 1): +    for j in range(N - M + 1): +        t = True +        for k in range(M): +            if B[k] != A[i + k][j : j + M]: +                t = False +        if t: