#include <bits/stdc++.h>
using namespace std;
char c[1100][1100];
int a[1100][1011];
int k1, k2, k3, k4;
void check(int i, int j) {
  if (a[i][j] == -1) k1 = 1;
  if (a[i][j] == -2) k2 = 1;
  if (a[i][j] == -3) k3 = 1;
  if (a[i][j] == -4) k4 = 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> c[i][j];
  int r = 0;
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) {
      if (c[i][j] == 'b') {
        if (c[i][j - 1] == 'w' && c[i][j + 1] == 'w' && a[i][j - 1] == 0 &&
            a[i][j + 1] == 0) {
          r++;
          a[i][j - 1] = a[i][j] = a[i][j + 1] = r;
        } else if (c[i - 1][j] == 'w' && c[i + 1][j] == 'w' &&
                   a[i - 1][j] == 0 && a[i + 1][j] == 0) {
          r++;
          a[i - 1][j] = a[i][j] = a[i + 1][j] = r;
        }
      }
    }
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) {
      if (a[i][j] > 0) {
        int i1 = i, i2 = i, j1 = j, j2 = j;
        while (a[i1][j] == a[i][j]) i1--;
        i1++;
        while (a[i2][j] == a[i][j]) i2++;
        i2--;
        while (a[i][j1] == a[i][j]) j1--;
        j1++;
        while (a[i][j2] == a[i][j]) j2++;
        j2--;
        k1 = 0, k2 = 0, k3 = 0, k4 = 0;
        for (int I = i1; I <= i2; I++)
          for (int J = j1; J <= j2; J++) {
            check(I, J - 1);
            check(I, J + 1);
            check(I + 1, J);
            check(I - 1, J);
          }
        int f = 0;
        if (k1 == 0) f = -1;
        if (k2 == 0) f = -2;
        if (k3 == 0) f = -3;
        if (k4 == 0) f = -4;
        for (int I = i1; I <= i2; I++)
          for (int J = j1; J <= j2; J++) a[I][J] = f;
      }
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 0 && c[i][j] != '.') {
        cout << "NO" << endl;
        return 0;
      }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 0)
        cout << '.';
      else if (a[i][j] == -1)
        cout << 'a';
      else if (a[i][j] == -2)
        cout << 'b';
      else if (a[i][j] == -3)
        cout << 'c';
      else
        cout << 'd';
    cout << endl;
  }
}
