#include <bits/stdc++.h>
using namespace std;
using namespace rel_ops;
const double PI = acos((double)-1);
int ts, ts2, ts3, ts4;
int n, m;
long long gcd(long long x, long long y) {
  long long t;
  for (; y != 0;) {
    t = x % y;
    x = y;
    y = t;
  }
  return x;
}
char a[1009][1005];
int main() {
  int i, j, k, l, t1, t2, t3, t4, t5, t6, t7, t8, t9, t, nw;
  int tt1, tt2, tt3, tt4;
  double u1, u2, u3, u4, u5, u6, u7, u8, u9;
  char c1, c2, c3;
  srand((unsigned)time(0));
  cin >> n >> m;
  for (i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      if (a[i][j] != 'b') continue;
      if (a[i - 1][j] == 'w' && a[i + 1][j] == 'w') {
        t1 = (i - 1) % 2 * 2 + j % 2 + 'p';
        a[i - 1][j] = a[i][j] = a[i + 1][j] = t1;
      } else if (a[i][j - 1] == 'w' && a[i][j + 1] == 'w') {
        t1 = i % 2 * 2 + (j - 1) % 2 + 'p';
        a[i][j - 1] = a[i][j] = a[i][j + 1] = t1;
      }
    }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (a[i][j] == 'b' || a[i][j] == 'w') {
        printf("NO\n");
        exit(0);
      }
  printf("YES\n");
  for (i = 1; i <= n; i++, cout << endl)
    for (j = 1; j <= m; j++)
      printf("%c", a[i][j] == '.' ? a[i][j] : a[i][j] - 'p' + 'a');
  return 0;
}
