inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
l = inp.shift().split(' ')
N = l.shift() * 1
M = l.shift() * 1 
a = []
b = []
for (i=0;i<N;i++) {
    a[i] = inp[i].split('')
}
for (i=0;i<M;i++) {
    b[i] = inp[i+N].split('')
}
f = 0
for (i=0;i<=N-M;i++) {
    for (j=0;j<=N-M;j++) {
        g = 1
        for (k=0;k<M;k++) {
            for (l=0;l<M;l++) {
                if (a[i+k][j+l] != b[k][l]) {
                    g = 0
                    break;
                } 
            }
            if (!g) {
                break;
            }
        }
        if (g) {
            f = 1
            break;
        }
    }
    if (g) {
        f = 1
        break;
    }
}
console.log(f ? 'Yes' : 'No')