#include <bits/stdc++.h>
using namespace std;
char mas[1100][1100];
char res[1100][1100];
char check(int n, int m, bool h) {
  char r = 'a';
  if (h) {
    while (res[n - 1][m - 1] == r || res[n - 1][m] == r ||
           res[n - 1][m + 1] == r || res[n - 1][m + 2] == r ||
           res[n - 1][m + 3] == r || res[n][m - 1] == r ||
           res[n + 1][m - 1] == r || res[n + 1][m] == r ||
           res[n + 1][m + 1] == r || res[n + 1][m + 2] == r ||
           res[n + 1][m + 3] == r || res[n][m + 3] == r)
      r++;
  } else {
    while (res[n - 1][m - 1] == r || res[n][m] == r || res[n + 1][m - 1] == r ||
           res[n + 2][m - 1] == r || res[n + 3][m - 1] == r ||
           res[n + 3][m] == r || res[n - 1][m + 1] == r || res[n][m + 1] == r ||
           res[n + 1][m + 1] == r || res[n + 2][m + 1] == r ||
           res[n + 3][m + 1] == r || res[n - 1][m] == r)
      r++;
  }
  return r;
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> mas[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mas[i][j] == '.')
        res[i][j] = '.';
      else
        res[i][j] = 'f';
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m - 2; j++) {
      if (mas[i][j] == 'w' && mas[i][j + 1] == 'b' && mas[i][j + 2] == 'w') {
        char c = check(i, j, 1);
        res[i][j] = c;
        mas[i][j] = '.';
        res[i][j + 1] = c;
        mas[i][j + 1] = '.';
        res[i][j + 2] = c;
        mas[i][j + 2] = '.';
      }
    }
    if (i < n - 2) {
      for (int j = 0; j < m; j++) {
        if (mas[i][j] == 'w' && mas[i + 1][j] == 'b' && mas[i + 2][j] == 'w') {
          char c = check(i, j, 0);
          res[i][j] = c;
          mas[i][j] = '.';
          res[i + 1][j] = c;
          mas[i + 1][j] = '.';
          res[i + 2][j] = c;
          mas[i + 2][j] = '.';
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (res[i][j] == 'f') {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << res[i][j];
    }
    cout << endl;
  }
  return 0;
}
