#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long add(long long x, long long y, long long CMOD = MOD) {
  return (x + y + CMOD + CMOD) % CMOD;
}
long long mult(long long x, long long y, long long CMOD = MOD) {
  return add(x, 0) * add(y, 0) % CMOD;
}
long long fast_expo(long long x, long long y, long long CMOD = MOD) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  long long ans = fast_expo(x, y / 2, CMOD);
  ans = mult(ans, ans, CMOD);
  if (y & 1) ans = mult(ans, x, CMOD);
  return ans;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long gen(long long x, long long y) {
  if (x == y) return x;
  return x + rng() % (y - x + 1);
}
const int TAM = 1e3 + 10;
const long long INF = LLONG_MAX / 4;
int n, m;
char s[TAM][TAM];
bool can[TAM][TAM];
char col[TAM][TAM];
string c = "ac";
string f = "bd";
void print() {
  cout << "COLOR" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << col[i][j];
    cout << endl;
  }
}
bool process() {
  for (int j = 0; j < m; j++) {
    for (int i = 0; i < n; i++) {
      if (!can[i][j] or s[i][j] == 'w') continue;
      bool ok = true;
      ok &= i - 1 >= 0 and can[i - 1][j] and s[i - 1][j] == 'w';
      ok &= can[i][j] and s[i][j] == 'b';
      ok &= i + 1 < n and can[i + 1][j] and s[i + 1][j] == 'w';
      if (!ok) return false;
      can[i - 1][j] = can[i][j] = can[i + 1][j] = false;
      col[i - 1][j] = col[i][j] = col[i + 1][j] = c[j % 2];
    }
    for (int i = 0; i < n; i++) {
      if (!can[i][j] or s[i][j] == 'b') continue;
      bool ok = true;
      ok &= can[i][j] and s[i][j] == 'w';
      ok &= j + 1 < m and can[i][j + 1] and s[i][j + 1] == 'b';
      ok &= j + 2 < m and can[i][j + 2] and s[i][j + 2] == 'w';
      if (!ok) return false;
      can[i][j] = can[i][j + 1] = can[i][j + 2] = false;
      col[i][j] = col[i][j + 1] = col[i][j + 2] = f[i % 2];
    }
  }
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      can[i][j] = s[i][j] != '.';
      col[i][j] = '.';
    }
  }
  if (!process())
    puts("NO");
  else {
    puts("YES");
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) printf("%c", col[i][j]);
      puts("");
    }
  }
  return 0;
}
