#include <bits/stdc++.h>
using namespace std;
char E[1005][1005];
char D[1005][1005];
char getc1() {
  char c = getchar();
  while (c != '.' && c != 'w' && c != 'b') c = getchar();
  return c;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    E[i][0] = '.';
    for (int j = 1; j <= m; j++) {
      E[i][j] = getc1();
      if (D[i][j] && E[i][j] == '.') {
        puts("NO");
        return 0;
      }
      if (D[i][j]) E[i][j] = '.';
    }
    for (int j = 1; j <= m; j++) {
      if (E[i][j] == 'b' && E[i][j - 1] == '.') {
        puts("NO");
        return 0;
      }
      if (E[i][j] == 'w' && E[i][j - 1] == '.') {
        if (E[i][j + 1] == 'b') {
          if (E[i][j + 2] == 'w') {
            E[i][j] = E[i][j + 1] = E[i][j + 2] = '.';
            D[i][j] = D[i][j + 1] = D[i][j + 2] = (i % 2 ? 'a' : 'b') - '.';
          } else {
            puts("NO");
            return 0;
          }
        } else {
          E[i][j] = '.';
          D[i][j] = D[i + 1][j] = D[i + 2][j] = (j % 2 ? 'c' : 'd') - '.';
          if (i + 2 > n) {
            puts("NO");
            return 0;
          }
        }
      }
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) putchar(D[i][j] + '.');
    putchar(10);
  }
  return 0;
}
