Option Strict On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Dim N, M As Integer
    Dim A, B As String()

    Sub Main()
        N = NextInt()
        M = NextInt()
        A = New String(N - 1) {}
        B = New String(M - 1) {}

        For i As Integer = 0 To N - 1
            A(i) = ReadLine()
        Next

        For i As Integer = 0 To M - 1
            B(i) = ReadLine()
        Next

        Dim ans As String = "No"

        For Ni As Integer = 0 To N - 1
            For Nj As Integer = 0 To N - 1
                If Judge(Ni, Nj) Then
                    ans = "Yes"
                    Exit For
                End If
            Next
            If ans = "Yes" Then Exit For
        Next

        WriteLine(ans)
    End Sub

    Function Judge(Ni As Integer, Nj As Integer) As Boolean
        For i As Integer = 0 To M - 1
            For j As Integer = 0 To M - 1
                If Ni + i >= N OrElse Nj + j >= N Then Return False
                If B(i)(j) <> A(Ni + i)(Nj + j) Then Return False
            Next
        Next

        Return True
    End Function

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
