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

a = [list(eval(input())) for _ in range(n)]

b = [list(eval(input())) for _ in range(m)]



for i in range(n):

    for j in range(n):

        if j+m <= n and i+m <= n:

            if [a[i+k][j:j+m] for k in range(m)] == b:

                print('Yes')

                exit()

else:

    print('No')

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

a = [eval(input()) for _ in range(n)]

b = [eval(input()) for _ in range(m)]



for i in range(n):

    for j in range(n):

        if a[i][j] == b[0][0]:

            if j+m <= n and i+m <= n:

                if [a[i+k][j:j+m] for k in range(m)] == b:

                    print('Yes')

                    exit()

else:

    print('No')

n, m = list(map(int, input().split()))
a = [list(eval(input())) for _ in range(n)]
b = [list(eval(input())) for _ in range(m)]
for i in range(n):
    for j in range(n):
        if j + m <= n and i + m <= n:
            if [a[i + k][j : j + m] for k in range(m)] == b:
                print("Yes")
                exit()
else:
    print("No")

n, m = list(map(int, input().split()))
a = [eval(input()) for _ in range(n)]
b = [eval(input()) for _ in range(m)]
for i in range(n):
    for j in range(n):
        if a[i][j] == b[0][0]:
            if j + m <= n and i + m <= n:
                if [a[i + k][j : j + m] for k in range(m)] == b:
                    print("Yes")
                    exit()
else:
    print("No")

-a = [list(eval(input())) for _ in range(n)] -b = [list(eval(input())) for _ in range(m)] +a = [eval(input()) for _ in range(n)] +b = [eval(input()) for _ in range(m)] -        if j + m <= n and i + m <= n: -            if [a[i + k][j : j + m] for k in range(m)] == b: -                print("Yes") -                exit() +        if a[i][j] == b[0][0]: +            if j + m <= n and i + m <= n: +                if [a[i + k][j : j + m] for k in range(m)] == b: +                    print("Yes") +                    exit()