import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int n, m;
	{
		int[] tmp = readln.chomp.split.map!(to!int).array;
		n = tmp[0], m = tmp[1];
		}
	
	bool[][] ass, bss;
	for(int j = 0; j < n; j ++){
		bool[] as = readln.chomp.map!(c => c == '#').array;
		ass ~= as;
		}
	for(int j = 0; j < m; j ++){
		bool[] bs = readln.chomp.map!(c => c == '#').array;
		bss ~= bs;
		}
	
	bool f = 0;
	for(int x = 0; x < n - m; x ++){
		for(int y = 0; y < n - m; y ++){
			f = 1;
			for(int i = 0; i < m ; i ++){
				for(int j = 0; j < m; j ++){
					if(ass[y + j][x + i] != bss[j][i]){
						f = 0;
						break;
						}
					}
				if(f == 0) break;
				}
			if(f == 1) break;
			}
		if(f == 1) break;
		}
	
	if(f == 1) "Yes".writeln;
	else "No".writeln;
	}