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

Alist = [list(eval(input())) for _ in range(N)]

Blist = [list(eval(input())) for _ in range(M)]





def check_in(add_tate, add_yoko):

    for A, B in zip(Alist[add_tate:add_tate + M], Blist):

        try:

            assert A[add_yoko:add_yoko + M] == B

        except AssertionError:

            return False

    return True





from sys import exit

if Alist == Blist:

    print("Yes")

    exit()

for add_tate in range(N - M):

    for add_yoko in range(N - M):

        if check_in(add_tate, add_yoko):

            print("Yes")

            exit()

print("No")

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

Alist = [list(eval(input())) for _ in range(N)]

Blist = [list(eval(input())) for _ in range(M)]

from sys import exit

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

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

        for A, B in zip(Alist[i:i + M], Blist):

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

                break

        else:

            print("Yes")

            exit()

print("No")

N, M = list(map(int, input().split()))
Alist = [list(eval(input())) for _ in range(N)]
Blist = [list(eval(input())) for _ in range(M)]


def check_in(add_tate, add_yoko):
    for A, B in zip(Alist[add_tate : add_tate + M], Blist):
        try:
            assert A[add_yoko : add_yoko + M] == B
        except AssertionError:
            return False
    return True


from sys import exit

if Alist == Blist:
    print("Yes")
    exit()
for add_tate in range(N - M):
    for add_yoko in range(N - M):
        if check_in(add_tate, add_yoko):
            print("Yes")
            exit()
print("No")

N, M = list(map(int, input().split()))
Alist = [list(eval(input())) for _ in range(N)]
Blist = [list(eval(input())) for _ in range(M)]
from sys import exit

for i in range(N - M + 1):
    for j in range(N - M + 1):
        for A, B in zip(Alist[i : i + M], Blist):
            if A[j : j + M] != B:
                break
        else:
            print("Yes")
            exit()
print("No")

- - -def check_in(add_tate, add_yoko): -    for A, B in zip(Alist[add_tate : add_tate + M], Blist): -        try: -            assert A[add_yoko : add_yoko + M] == B -        except AssertionError: -            return False -    return True - - -if Alist == Blist: -    print("Yes") -    exit() -for add_tate in range(N - M): -    for add_yoko in range(N - M): -        if check_in(add_tate, add_yoko): +for i in range(N - M + 1): +    for j in range(N - M + 1): +        for A, B in zip(Alist[i : i + M], Blist): +            if A[j : j + M] != B: +                break +        else: