#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[1004][1004];
int b[1004][1004];
int c[1000001];
bool mark[5];
int z;
void er() {
  printf("NO\n");
  exit(0);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (b[i][j] == 0 && a[i][j] == 'w') {
        if (a[i][j + 1] == 'b' && b[i][j + 1] == 0) {
          if (a[i][j + 2] == 'w' && b[i][j + 2] == 0) {
            z++;
            b[i][j] = b[i][j + 1] = b[i][j + 2] = z;
          } else
            er();
        } else {
          if (a[i + 1][j] == 'b' && a[i + 2][j] == 'w') {
            z++;
            b[i][j] = b[i + 1][j] = b[i + 2][j] = z;
          } else
            er();
        }
      }
      if (b[i][j] == 0 && a[i][j] == 'b') er();
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (b[i][j] && !c[b[i][j]]) {
        memset(mark, 0, sizeof(mark));
        if (b[i][j + 1] == b[i][j]) {
          for (int k = j; k <= j + 2; k++) mark[c[b[i - 1][k]]] = true;
          for (int k = j; k <= j + 2; k++) mark[c[b[i + 1][k]]] = true;
          mark[c[b[i][j - 1]]] = true;
          mark[c[b[i][j + 3]]] = true;
        } else {
          for (int k = i; k <= i + 2; k++) mark[c[b[k][j - 1]]] = true;
          for (int k = i; k <= i + 2; k++) mark[c[b[k][j + 1]]] = true;
          mark[c[b[i - 1][j]]] = true;
          mark[c[b[i + 3][j]]] = true;
        }
        for (int k = 1; k <= 4; k++)
          if (!mark[k]) {
            c[b[i][j]] = k;
            break;
          }
        if (!c[b[i][j]]) er();
      }
  printf("YES\n");
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (c[b[i][j]] == 0)
        printf(".");
      else
        printf("%c", (char)(c[b[i][j]] + 'a' - 1));
    printf("\n");
  }
  return 0;
}
