#include <bits/stdc++.h>
using namespace std;
int ar[1002][1002], row, col;
int dx1[] = {0, 0, 1, 1, 1, -1, -1, -1}, dy1[] = {-1, 3, 0, 1, 2, 0, 1, 2};
int dy2[] = {0, 0, 1, 1, 1, -1, -1, -1}, dx2[] = {-1, 3, 0, 1, 2, 0, 1, 2};
int main() {
  int n, m, i, a, b, c, d, j, k;
  cin >> n >> m;
  string s1[n];
  row = n;
  col = m;
  for (i = 0; i < n; i++) {
    cin >> s1[i];
  }
  int f = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      a = 0;
      b = 0;
      c = 0;
      d = 0;
      if ((m - j) >= 3 && s1[i][j] == 'w' && s1[i][j + 1] == 'b' &&
          s1[i][j + 2] == 'w' && ar[i][j + 1] == 0) {
        for (k = 0; k < 8; k++) {
          if (i + dx1[k] >= 0 && i + dx1[k] < row && j + dy1[k] >= 0 &&
              j + dy1[k] < col) {
            if (s1[i + dx1[k]][j + dy1[k]] == 'a') a = 1;
            if (s1[i + dx1[k]][j + dy1[k]] == 'b' &&
                ar[i + dx1[k]][j + dy1[k]] == 1)
              b = 1;
            if (s1[i + dx1[k]][j + dy1[k]] == 'c') c = 1;
            if (s1[i + dx1[k]][j + dy1[k]] == 'd') d = 1;
          }
        }
        if (a == 0) {
          s1[i][j] = 'a';
          s1[i][j + 1] = 'a';
          s1[i][j + 2] = 'a';
        } else if (b == 0) {
          s1[i][j] = 'b';
          s1[i][j + 1] = 'b';
          s1[i][j + 2] = 'b';
        } else if (c == 0) {
          s1[i][j] = 'c';
          s1[i][j + 1] = 'c';
          s1[i][j + 2] = 'c';
        } else {
          s1[i][j] = 'd';
          s1[i][j + 1] = 'd';
          s1[i][j + 2] = 'd';
        }
        ar[i][j] = 1;
        ar[i][j + 1] = 1;
        ar[i][j + 2] = 1;
      } else if ((n - i) >= 3 && s1[i][j] == 'w' && s1[i + 1][j] == 'b' &&
                 s1[i + 2][j] == 'w' && ar[i + 1][j] == 0) {
        for (k = 0; k < 8; k++) {
          if (i + dx2[k] >= 0 && i + dx2[k] < row && j + dy2[k] >= 0 &&
              j + dy2[k] < col) {
            if (s1[i + dx2[k]][j + dy2[k]] == 'a') a = 1;
            if (s1[i + dx2[k]][j + dy2[k]] == 'b' &&
                ar[i + dx2[k]][j + dy2[k]] == 1)
              b = 1;
            if (s1[i + dx2[k]][j + dy2[k]] == 'c') c = 1;
            if (s1[i + dx2[k]][j + dy2[k]] == 'd') d = 1;
          }
        }
        if (a == 0) {
          s1[i][j] = 'a';
          s1[i + 1][j] = 'a';
          s1[i + 2][j] = 'a';
        } else if (b == 0) {
          s1[i][j] = 'b';
          s1[i + 1][j] = 'b';
          s1[i + 2][j] = 'b';
        } else if (c == 0) {
          s1[i][j] = 'c';
          s1[i + 1][j] = 'c';
          s1[i + 2][j] = 'c';
        } else {
          s1[i][j] = 'd';
          s1[i + 1][j] = 'd';
          s1[i + 2][j] = 'd';
        }
        ar[i][j] = 1;
        ar[i + 1][j] = 1;
        ar[i + 2][j] = 1;
      } else if ((s1[i][j] == 'w' || s1[i][j] == 'b') && ar[i][j] == 0) {
        f = 1;
        break;
      }
    }
    if (f == 1) break;
  }
  if (f == 0) {
    cout << "YES\n";
    for (i = 0; i < n; i++) cout << s1[i] << "\n";
  } else
    cout << "NO\n";
  return 0;
}
