local n,m=io.read("n","n","l")
local a={}
for i=1,n do
    a[i]=io.read()
end
local b={}
for i=1,m do
    b[i]=io.read()
end

for i=1,n-m+1 do
    for j=1,n-m+1 do
        local flag=true
        for k=i,i+m-1 do
            if a[k]:sub(j,j+m-1)~=b[k-m+1] then
                flag=false
            end
        end
        if flag then
            print("Yes")
            return
        end
    end
end
print("No")