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

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

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



flag = True

for i in range(n):

    if flag:

        for j in range(n):

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

                aa = []

                for k in range(m):

                    aa.append(a[i + k][j : j+m])

                if aa == b:

                    print('Yes')

                    flag = False

                    break



if flag:

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



def check():

    for i in range(n):

            for j in range(n):

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

                    aa = []

                    for k in range(m):

                        aa.append(a[i + k][j : j+m])

                    if aa == b:

                        return 'Yes'

    return 'No'



print((check()))
n, m = list(map(int, input().split()))
a = [list(eval(input())) for _ in range(n)]
b = [list(eval(input())) for _ in range(m)]
flag = True
for i in range(n):
    if flag:
        for j in range(n):
            if i + m <= n and j + m <= n:
                aa = []
                for k in range(m):
                    aa.append(a[i + k][j : j + m])
                if aa == b:
                    print("Yes")
                    flag = False
                    break
if flag:
    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)]


def check():
    for i in range(n):
        for j in range(n):
            if i + m <= n and j + m <= n:
                aa = []
                for k in range(m):
                    aa.append(a[i + k][j : j + m])
                if aa == b:
                    return "Yes"
    return "No"


print((check()))

-flag = True -for i in range(n): -    if flag: + + +def check(): +    for i in range(n): -                    print("Yes") -                    flag = False -                    break -if flag: -    print("No") +                    return "Yes" +    return "No" + + +print((check()))