#include <bits/stdc++.h>
using namespace std;
int n, m;
char board[1002][1002];
short ret[1002][1002];
int elegir1(int i, int j) {
  vector<bool> colores(4, false);
  if (j + 3 < m && ret[i][j + 3] != -1) colores[ret[i][j + 3]] = true;
  if (j > 0 && ret[i][j - 1] != -1) colores[ret[i][j - 1]] = true;
  for (int k = 0; k < 3; k++)
    if (i > 0 && ret[i - 1][j + k] != -1) colores[ret[i - 1][j + k]] = true;
  for (int k = 0; k < 3; k++)
    if (i < n - 1 && ret[i + 1][j + k] != -1) colores[ret[i + 1][j + k]] = true;
  for (int k = 0; k < 4; k++)
    if (!colores[k]) return k;
  return 0;
}
int elegir2(int i, int j) {
  vector<bool> colores(4, false);
  if (i + 3 < n && ret[i + 3][j] != -1) colores[ret[i + 3][j]] = true;
  if (i > 0 && ret[i - 1][j] != -1) colores[ret[i - 1][j]] = true;
  for (int k = 0; k < 3; k++)
    if (j > 0 && ret[i + k][j - 1] != -1) colores[ret[i + k][j - 1]] = true;
  for (int k = 0; k < 3; k++)
    if (j < m - 1 && ret[i + k][j + 1] != -1) colores[ret[i + k][j + 1]] = true;
  for (int k = 0; k < 4; k++)
    if (!colores[k]) return k;
  return 0;
}
void print() {
  cout << "@@@@@@@@@" << endl;
  for (int ii = 0; ii < n; ii++) {
    for (int jj = 0; jj < m; jj++) {
      if (ret[ii][jj] == -1)
        cout << '.';
      else
        cout << (char)('a' + ret[ii][jj]);
    }
    cout << endl;
  }
}
int main() {
  cin >> n >> m;
  memset(ret, -1, sizeof(ret));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> board[i][j];
  bool posible = true;
  for (int i = 0; i < n && posible; i++)
    for (int j = 0; j < m && posible; j++) {
      if (board[i][j] == '.' || ret[i][j] != -1) {
        continue;
      }
      if (board[i][j] == 'b') {
        posible = false;
        break;
      }
      if (j <= m - 3 && (board[i][j + 1] != '.' && ret[i][j + 1] == -1) &&
          (board[i][j + 2] != '.' && ret[i][j + 2] == -1)) {
        int color = elegir1(i, j);
        ret[i][j] = color;
        ret[i][j + 1] = color;
        ret[i][j + 2] = color;
        continue;
      }
      if (i <= n - 3 && (board[i + 1][j] != '.' && ret[i + 1][j] == -1) &&
          (board[i + 2][j] != '.' && ret[i + 2][j] == -1)) {
        int color = elegir2(i, j);
        ret[i][j] = color;
        ret[i + 1][j] = color;
        ret[i + 2][j] = color;
        continue;
      }
      posible = false;
    }
  if (posible) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        if (ret[i][j] == -1)
          cout << '.';
        else
          cout << (char)('a' + ret[i][j]);
      }
      cout << endl;
    }
  } else
    cout << "NO" << endl;
  return 0;
}
