#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<bool>> fieldBool(H, vector<bool>(W, 0));
  string temp;
  vector<vector<int>> actions = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
  vector<int> action(2);
  int h, w;
  for (int i = 0; i < H; i++) {
    cin >> temp;
    for (int j = 0; j < W; j++) {
      if (temp[j] == '#') {
        fieldBool[i][j] = 1;
      }
    }
  }
  bool ans = true;
  for (int i = 0; i < H; i++) {
    cin >> temp;
    for (int j = 0; j < W; j++) {
      for (int k = 0; k < 4; k++) {
        ans = false;
        action = actions[k];
        h = action[0] + i;
        w = action[1] + j;
        if (h >= 0 && h < H && w >= 0 && w < W) {
          if (fieldBool[h][w] == 1) {
            ans = true;
            break;
          }
        }
      }
      if (ans == false) break;
    }
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
