#include <bits/stdc++.h>
using namespace std;
const int u[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
pair<int, int> block[400000][3];
char field[1000][1001];
int color[1000][1000];
int mask[400000];
void noAnswer() {
  printf("NO\n");
  exit(0);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", field[i]);
  memset(color, -1, sizeof(color));
  int cur = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (field[i][j] != 'b') continue;
      if (i > 0 && color[i - 1][j] == -1 && field[i - 1][j] == 'w') {
        if (i + 1 >= n || field[i + 1][j] != 'w') noAnswer();
        block[cur][0] = make_pair(i - 1, j);
        block[cur][1] = make_pair(i, j);
        block[cur][2] = make_pair(i + 1, j);
        color[i - 1][j] = color[i][j] = color[i + 1][j] = cur++;
      } else if (j > 0 && color[i][j - 1] == -1 && field[i][j - 1] == 'w') {
        if (j + 1 >= m || field[i][j + 1] != 'w') noAnswer();
        block[cur][0] = make_pair(i, j - 1);
        block[cur][1] = make_pair(i, j);
        block[cur][2] = make_pair(i, j + 1);
        color[i][j - 1] = color[i][j] = color[i][j + 1] = cur++;
      } else {
        noAnswer();
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (field[i][j] != '.' && color[i][j] == -1) noAnswer();
  memset(mask, -1, sizeof(mask));
  for (int i = 0; i < cur; i++) {
    bool check[4] = {false};
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 4; k++) {
        int t1 = block[i][j].first + u[k][0];
        int t2 = block[i][j].second + u[k][1];
        if (0 <= t1 && t1 < n && 0 <= t2 && t2 < m && mask[color[t1][t2]] != -1)
          check[mask[color[t1][t2]]] = true;
      }
    for (int j = 0; j < 4; j++)
      if (!check[j]) {
        mask[i] = j;
        break;
      }
  }
  printf("YES\n");
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (field[i][j] == '.') {
        printf(".");
      } else {
        printf("%c", (char)(mask[color[i][j]] + 'a'));
      }
    }
    printf("\n");
  }
  return 0;
}
