# -*- coding: utf-8 -*-



# AtCoder Beginner Contest

# Problem B





if __name__ == '__main__':

    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 - m + 1):

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

            is_exist = True



            for dx in range(m):

                for dy in range(m):

                    if a[i + dx][j + dy] != b[dx][dy]:

                        is_exist = False



            if is_exist:

                print('Yes')

                exit()



    print('No')

# -*- coding: utf-8 -*-



# AtCoder Beginner Contest

# Problem B





if __name__ == '__main__':

    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 - m + 1):

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

            is_exist = True



            for dx in range(m):

                for dy in range(m):

                    if a[i + dx][j + dy] != b[dx][dy]:

                        is_exist = False

                        break



            if is_exist:

                print('Yes')

                exit()



    print('No')

# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == "__main__":
    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 - m + 1):
        for j in range(n - m + 1):
            is_exist = True
            for dx in range(m):
                for dy in range(m):
                    if a[i + dx][j + dy] != b[dx][dy]:
                        is_exist = False
            if is_exist:
                print("Yes")
                exit()
    print("No")

# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == "__main__":
    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 - m + 1):
        for j in range(n - m + 1):
            is_exist = True
            for dx in range(m):
                for dy in range(m):
                    if a[i + dx][j + dy] != b[dx][dy]:
                        is_exist = False
                        break
            if is_exist:
                print("Yes")
                exit()
    print("No")

+                        break