#include <bits/stdc++.h>
using namespace std;
int m, n, j, k, l, i, o, p, __t;
char ch;
void read(int &a) {
  for (ch = getchar(); (ch < '0' || ch > '9') && (ch != '-'); ch = getchar())
    ;
  if (ch == '-')
    a = 0, __t = -1;
  else
    a = ch - '0', __t = 1;
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    a = a * 10 + ch - '0';
  a *= __t;
}
string S[2000];
char ans[2000][2000];
bool exist[2000][2000];
int Go[4][2] = {0, 1, 0, -1, 1, 0, -1, 0};
void cover(int x, int y, int addx, int addy) {
  bool could[4] = {1, 1, 1, 1};
  for (int i = 0; i < 3; i++) {
    int X = x + addx * i;
    int Y = y + addy * i;
    for (int j = 0; j < 4; j++) {
      int nx = X + Go[j][0];
      int ny = Y + Go[j][1];
      if (nx < 1 || ny < 1 || nx > m || ny > n || ans[nx][ny] == '.') continue;
      could[ans[nx][ny] - 'a'] = 0;
    }
  }
  for (int i = 0; i < 4; i++)
    if (could[i]) {
      ch = 'a' + i;
      break;
    }
  for (int i = 0; i < 3; i++) {
    ans[x + addx * i][y + addy * i] = ch;
    exist[x + addx * i][y + addy * i] = 1;
  }
}
int main() {
  read(m), read(n);
  for (int i = 1; i <= m; i++) {
    cin >> S[i];
    S[i] = " " + S[i];
  }
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) ans[i][j] = '.';
  bool could = 1;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      if (S[i][j] == 'w' && exist[i][j] == 0) {
        bool can = 1;
        if (j + 2 > n) can = 0;
        if (can && (S[i][j + 1] != 'b' || S[i][j + 2] != 'w' ||
                    exist[i][j + 1] || exist[i][j + 2]))
          can = 0;
        if (can) {
          cover(i, j, 0, 1);
          continue;
        }
        if (i + 2 > m) {
          could = 0;
          continue;
        }
        if (S[i + 1][j] != 'b' || S[i + 2][j] != 'w') {
          could = 0;
          continue;
        }
        cover(i, j, 1, 0);
      }
  if (!could)
    printf("NO\n");
  else
    printf("YES\n");
  if (could) {
    for (int i = 1; i <= m; i++, printf("\n"))
      for (int j = 1; j <= n; j++) printf("%c", ans[i][j]);
  }
}
