#include<iostream>
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
char a[53][53],b[53][53];
int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=0;i<n;++i){
		scanf("%s",a[i]);
	}for(int i=0;i<m;++i){
		scanf("%s",b[i]);
		
	}for(int i=0;i<n;++i){
		for(int j=0;j<n;++j){
			bool found=true;
			for (int k=i,k2=0;k<m+i;++k,++k2){
				for(int l=j,l2=0;l<m+j;++l,++l2){
					if(a[k][l]!=b[k2][l2])
					found=false;
				}
			}if (found==true){puts("Yes");
			return 0;
			}
		}
	}
	puts("No");
	
}