#include <bits/stdc++.h>
using namespace std;
int N, M;
char mat[1100][1100];
int ans[1100][1100];
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int main(int argc, char** argv) {
  int i, j, k, u;
  while (scanf("%d%d", &N, &M) != EOF) {
    memset(ans, 0, sizeof(ans));
    memset(mat, 0, sizeof(mat));
    for (i = 1; i <= N; i++) scanf("%s", mat[i] + 1);
    bool yes = true;
    for (i = 1; i <= N && yes; i++)
      for (j = 1; j <= M && yes; j++)
        if (mat[i][j] == 'b') {
          yes = false;
          if (mat[i - 1][j] == 'w' && mat[i + 1][j] == 'w' &&
              ans[i - 1][j] == 0 && ans[i + 1][j] == 0) {
            int mask = 0;
            for (k = 0; k < 4; k++) mask |= ans[i + 1 + dx[k]][j + dy[k]];
            for (k = 0; k < 4; k++) mask |= ans[i + dx[k]][j + dy[k]];
            for (k = 0; k < 4; k++) mask |= ans[i - 1 + dx[k]][j + dy[k]];
            for (k = 0; k < 4; k++)
              if (((1 << k) & mask) == 0) break;
            ans[i - 1][j] = ans[i][j] = ans[i + 1][j] = (1 << k);
            yes = true;
            continue;
          }
          if (mat[i][j - 1] == 'w' && mat[i][j + 1] == 'w' &&
              ans[i][j - 1] == 0 && ans[i][j + 1] == 0) {
            int mask = 0;
            for (k = 0; k < 4; k++) mask |= ans[i + dx[k]][j + 1 + dy[k]];
            for (k = 0; k < 4; k++) mask |= ans[i + dx[k]][j + dy[k]];
            for (k = 0; k < 4; k++) mask |= ans[i + dx[k]][j - 1 + dy[k]];
            for (k = 0; k < 4; k++)
              if (((1 << k) & mask) == 0) break;
            ans[i][j - 1] = ans[i][j] = ans[i][j + 1] = (1 << k);
            yes = true;
            continue;
          }
        }
    for (i = 1; i <= N; i++)
      for (j = 1; j <= M; j++)
        if (mat[i][j] != '.' && ans[i][j] == 0) yes = false;
    if (!yes) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
    for (i = 1; i <= N; i++) {
      for (j = 1; j <= M; j++)
        if (mat[i][j] == '.')
          printf(".");
        else {
          for (k = 0; k < 4; k++)
            if ((1 << k) & ans[i][j]) break;
          printf("%c", k + 'a');
        }
      printf("\n");
    }
  }
  return (EXIT_SUCCESS);
}
