#include <bits/stdc++.h>
using namespace std;
int N, M;
int Colors[2000][2000];
int Board[2000][2000];
bool IsTrue(int i, int j) { return (i >= 0 && i < N && j >= 0 && j < M); }
int GetColor(int i, int j) {
  if (IsTrue(i, j)) {
    return Colors[i][j];
  } else
    return 1000;
}
int GetC(vector<int> col) {
  int Col = 1;
  sort(col.begin(), col.end());
  col.resize(unique(col.begin(), col.end()) - col.begin());
  for (int i = 0; i < col.size(); ++i) {
    if (Col != col[i])
      return Col;
    else
      Col++;
  }
  return Col;
}
int main() {
  for (int i = 0; i < 2000; ++i) {
    for (int j = 0; j < 2000; ++j) Colors[i][j] = 1000;
  }
  cin >> N >> M;
  for (int i = 0; i < N; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < s.length(); ++j) {
      if (s[j] == '.') Board[i][j] = 0;
      if (s[j] == 'w') Board[i][j] = 2;
      if (s[j] == 'b') Board[i][j] = 1;
    }
  }
  for (int j = 0; j < M; ++j) {
    for (int i = 0; i < N; ++i) {
      if (i + 3 <= N && Board[i][j] == 2 && Board[i + 1][j] == 1 &&
          Board[i + 2][j] == 2) {
        Board[i][j] = 0;
        Board[i + 1][j] = 0;
        Board[i + 2][j] = 0;
        vector<int> col;
        col.push_back(GetColor(i - 1, j));
        col.push_back(GetColor(i + 3, j));
        col.push_back(GetColor(i, j - 1));
        col.push_back(GetColor(i, j + 1));
        col.push_back(GetColor(i + 1, j - 1));
        col.push_back(GetColor(i + 1, j + 1));
        col.push_back(GetColor(i + 2, j - 1));
        col.push_back(GetColor(i + 2, j + 1));
        int c = GetC(col);
        if (c >= 5) {
          cout << "NO" << endl;
          return 0;
        }
        Colors[i][j] = c;
        Colors[i + 1][j] = c;
        Colors[i + 2][j] = c;
      }
      if (j + 3 <= M && Board[i][j] == 2 && Board[i][j + 1] == 1 &&
          Board[i][j + 2] == 2) {
        Board[i][j] = 0;
        Board[i][j + 1] = 0;
        Board[i][j + 2] = 0;
        vector<int> col;
        col.push_back(GetColor(i, j - 1));
        col.push_back(GetColor(i, j + 3));
        col.push_back(GetColor(i - 1, j));
        col.push_back(GetColor(i + 1, j));
        col.push_back(GetColor(i - 1, j + 1));
        col.push_back(GetColor(i + 1, j + 1));
        col.push_back(GetColor(i - 1, j + 2));
        col.push_back(GetColor(i + 1, j + 2));
        int c = GetC(col);
        if (c >= 5) {
          cout << "NO" << endl;
          return 0;
        }
        Colors[i][j] = c;
        Colors[i][j + 1] = c;
        Colors[i][j + 2] = c;
      }
    }
  }
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < M; ++j) {
      if (Board[i][j] != 0) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < M; ++j) {
      if (Colors[i][j] == 1000)
        cout << '.';
      else
        cout << char(Colors[i][j] - 1 + 'a');
    }
    cout << endl;
  }
  return 0;
}
