#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "NO\n";
  exit(0);
}
void yes() { cout << "YES\n"; }
int nxt() {
  int x;
  cin >> x;
  return x;
}
string s = "0123";
vector<vector<char> > a;
int n, m;
bool outside(int x, int y) {
  if (x >= 1 && x <= n && y >= 1 && y <= m)
    return 0;
  else
    return 1;
}
void place(int x, int y, int dx, int dy) {
  if (outside(x, y)) no();
  char dom;
  for (char ch : s) {
    bool ok = 1;
    for (int j = (int)y; j < (int)y + dy; j++) {
      if (a[x - 1][y] == ch || a[x + dx][y] == ch) ok = 0;
    }
    for (int i = (int)x; i < (int)x + dx; i++) {
      if (a[i][y - 1] == ch || a[i][y + dy] == ch) ok = 0;
    }
    if (ok) {
      dom = ch;
      break;
    }
  }
  string placed;
  for (int i = (int)x; i < (int)x + dx; i++) {
    for (int j = (int)y; j < (int)y + dy; j++) {
      if (outside(i, j)) no();
      if (a[i][j] == 'w' || a[i][j] == 'b') {
        placed += a[i][j];
        a[i][j] = dom;
      } else {
        no();
      }
    }
  }
  if (placed != "wbw") no();
}
void solve() {
  cin >> n >> m;
  a = vector<vector<char> >(n + 5, vector<char>(m + 5));
  for (int i = (int)1; i < (int)n + 1; i++) {
    for (int j = (int)1; j < (int)m + 1; j++) cin >> a[i][j];
  }
  for (int j = (int)1; j < (int)m + 1; j++) {
    for (int i = (int)1; i < (int)n + 1; i++) {
      if (a[i][j] == 'b') {
        place(i - 1, j, 3, 1);
      }
    }
    for (int i = (int)1; i < (int)n + 1; i++) {
      if (a[i][j] == 'w') {
        place(i, j, 1, 3);
      }
    }
  }
  yes();
  for (int i = (int)1; i < (int)n + 1; i++) {
    for (int j = (int)1; j < (int)m + 1; j++)
      cout << (a[i][j] == '.' ? '.' : char('a' + a[i][j] - 48));
    cout << "\n";
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int tc = 1; tc <= t; tc++) {
    solve();
  }
}
