#include <iostream>
#define REP(i, a, n) for(int (i) = (a); (i) < (n); (i)++)
using namespace std;

int N, M;
string A[50];
string B[50];

bool included(int p, int q) {
  REP(i, 0, M)
    REP(j, 0, M)
      if(A[p + i][q + j] != B[i][j]) return false;
  return true;
}

int main(void) {
  cin >> N >> M;
  REP(i, 0, N) cin >> A[i];
  REP(i, 0, M) cin >> B[i];

  REP(i, 0, N - M + 1)
    REP(j, 0, N - M + 1)
      if(included(i, j)) {
        cout << "Yes" << endl;
        return 0;
      }

  cout << "No" << endl;
  return 0;
}
