read n m;
a=;
for((i=0;i<n;i++))do
	read s;
	a=("${a[@]}" "$s");
done
b=;
for((i=0;i<m;i++))do
	read s;
	b=("${b[@]}" "$s");
done
for((i=0;i<=n-m;i++))do
	for((j=0;j<=n-m;j++))do
		c=1;
		for((k=0;k<m;k++))do
			for((l=0;l<m;l++))do
				if [ ${a[$[i+k]]:$[j+l]:1} != ${b[$k]:$l:1} ];then
					c=0;
					break;
				fi
			done
			if [ $c -eq 0 ];then
				break;
			fi
		done
		if [ $c -eq 1 ];then
			echo Yes
			exit
		fi
	done
done
echo No
