#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<char> > desk;
vector<vector<int> > type;
int get_num(int X, int Y, int dx, int dy) {
  vector<bool> used(10, true);
  for (int i = 0; i < 3; i++) {
    int x = X + i * dx, y = Y + i * dy;
    if (x > 0) used[type[x - 1][y] + 2] = false;
    used[type[x + 1][y] + 2] = false;
    if (y > 0) used[type[x][y - 1] + 2] = false;
    used[type[x][y + 1] + 2] = false;
  }
  for (int i = 1 + 2; i < 5 + 2; i++)
    if (used[i]) return i - 2;
  cout << "NO" << endl;
  exit(0);
}
int main() {
  cin >> n >> m;
  desk.resize(n + 10, vector<char>(m + 10, '.'));
  type.resize(n + 10, vector<int>(m + 10, -1));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> desk[i][j];
      if (desk[i][j] != '.') type[i][j] = 0;
    }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (type[i][j]) continue;
      if (desk[i][j] == 'b') {
        cout << "NO" << endl;
        return 0;
      }
      if (!type[i][j + 1]) {
        if (!type[i][j + 1]) {
          int tp = get_num(i, j, 0, 1);
          type[i][j] = tp;
          type[i][j + 1] = tp;
          type[i][j + 2] = tp;
        }
        continue;
      }
      if (type[i + 1][j] || type[i + 2][j]) {
        cout << "NO" << endl;
        return 0;
      }
      int tp = get_num(i, j, 1, 0);
      type[i][j] = tp;
      type[i + 1][j] = tp;
      type[i + 2][j] = tp;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (type[i][j] == -1)
        cout << '.';
      else
        cout << (char)('a' + type[i][j] - 1);
    }
    cout << endl;
  }
  return 0;
}
