#include <bits/stdc++.h>
using namespace std;
int stat[1000][1000];
int n, m;
char field[1000][1001];
int mov[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
bool isUsed(int i, int j, char tar) {
  for (int q = 0; q < 4; q++) {
    int ny = i + mov[q][0];
    int nx = j + mov[q][1];
    if (ny >= 0 && ny < n && nx >= 0 && nx < m) {
      if (field[ny][nx] == tar) return true;
    }
  }
  return false;
}
int main(void) {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", field[i]);
  int cnt = 0;
  bool isFailed = false;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (field[j][i] == 'b') {
        if (j > 0 && field[j - 1][i] == 'w' && j < n - 1 &&
            field[j + 1][i] == 'w') {
          bool flag = false;
          for (int q = 'A'; q <= 'D'; q++) {
            if (!isUsed(j - 1, i, q) && !isUsed(j, i, q) &&
                !isUsed(j + 1, i, q)) {
              field[j - 1][i] = field[j][i] = field[j + 1][i] = q;
              flag = true;
              break;
            }
          }
          if (!flag) isFailed = true;
        }
      }
    }
    for (int j = 0; j < n; j++) {
      if (field[j][i] == 'w') {
        if (i + 2 < m && field[j][i + 1] == 'b' && field[j][i + 2] == 'w') {
          bool flag = false;
          for (int q = 'A'; q <= 'D'; q++) {
            if (!isUsed(j, i, q) && !isUsed(j, i + 1, q) &&
                !isUsed(j, i + 2, q)) {
              field[j][i] = field[j][i + 1] = field[j][i + 2] = q;
              flag = true;
              break;
            }
          }
          if (!flag) isFailed = true;
        }
      }
    }
  }
  bool isAble = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (field[i][j] == 'w' || field[i][j] == 'b') isAble = false;
  if (!isAble)
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (field[i][j] >= 'A' && field[i][j] <= 'D')
          field[i][j] = field[i][j] - 'A' + 'a';
    for (int i = 0; i < n; i++) printf("%s\n", field[i]);
  }
  return 0;
}
