import sys



def solve():

    n,m = list(map(int, sys.stdin.readline().split()))

    A = [sys.stdin.readline().rstrip() for _ in range(n)]

    B = [sys.stdin.readline().rstrip() for _ in range(m)]

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

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

            X = []

            for a in A[r:r+m]:

                X.append(a[c:c+m])

            if X == B:

                print('Yes')

                exit()

    print('No')



if __name__ == '__main__':

    solve()
def solve():

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

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

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

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

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

            X = []

            for i,a in enumerate(A[r:r+m]):

                if a[c:c+m] != B[i]:

                    break

            else:

                print('Yes')

                exit()

    print('No')



if __name__ == '__main__':

    solve()
import sys


def solve():
    n, m = list(map(int, sys.stdin.readline().split()))
    A = [sys.stdin.readline().rstrip() for _ in range(n)]
    B = [sys.stdin.readline().rstrip() for _ in range(m)]
    for r in range(n - m + 1):
        for c in range(n - m + 1):
            X = []
            for a in A[r : r + m]:
                X.append(a[c : c + m])
            if X == B:
                print("Yes")
                exit()
    print("No")


if __name__ == "__main__":
    solve()

def solve():
    n, m = list(map(int, input().split()))
    A = [eval(input()) for _ in range(n)]
    B = [eval(input()) for _ in range(m)]
    for r in range(n - m + 1):
        for c in range(n - m + 1):
            X = []
            for i, a in enumerate(A[r : r + m]):
                if a[c : c + m] != B[i]:
                    break
            else:
                print("Yes")
                exit()
    print("No")


if __name__ == "__main__":
    solve()

-import sys - - -    n, m = list(map(int, sys.stdin.readline().split())) -    A = [sys.stdin.readline().rstrip() for _ in range(n)] -    B = [sys.stdin.readline().rstrip() for _ in range(m)] +    n, m = list(map(int, input().split())) +    A = [eval(input()) for _ in range(n)] +    B = [eval(input()) for _ in range(m)] -            for a in A[r : r + m]: -                X.append(a[c : c + m]) -            if X == B: +            for i, a in enumerate(A[r : r + m]): +                if a[c : c + m] != B[i]: +                    break +            else: