#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w;
  cin >> h >> w;
  char s[h][w];
  for (int i; i < h; i++) {
    for (int j; j < w; j++) {
      cin >> s[i][j];
    }
  }
  for (int i; i < h; i++) {
    for (int j; j < w; j++) {
      if (s[i][j] == s[i + 1][j] || s[i][j] == s[i - 1][j] ||
          s[i][j] == s[i][j + 1] || s[i][j] == s[i][j - 1]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
