#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int n, m;
vector<string> s;
int mark[1005][1005];
const int d[4] = {-1, 0, 1, 0};
bool ok(int x, int y, char c) {
  for (int i = 0; i < 4; i++) {
    int nx = x + d[i];
    int ny = y + d[i ^ 1];
    if (nx < 0 or ny < 0 or nx >= n or ny >= m) continue;
    if (!mark[nx][ny]) continue;
    if (s[nx][ny] == c) return false;
  }
  return true;
}
bool horizon(int x, int y) {
  for (int i = 0; i < 2; i++) {
    if (y + i >= m) return false;
    if (mark[x][y + i]) return false;
  }
  if (s[x][y + 1] != 'b') return false;
  if (s[x][y + 2] != 'w') return false;
  for (char c : {'a', 'b', 'c', 'd'}) {
    if (ok(x, y, c) && ok(x, y + 1, c) && ok(x, y + 2, c)) {
      mark[x][y] = mark[x][y + 1] = mark[x][y + 2] = 1;
      s[x][y] = s[x][y + 1] = s[x][y + 2] = c;
      return true;
    }
  }
  return true;
}
bool vertical(int x, int y) {
  if (x + 2 >= n) return false;
  if (s[x + 1][y] != 'b' or s[x + 2][y] != 'w') return false;
  for (char c : {'a', 'b', 'c', 'd'}) {
    if (ok(x, y, c) && ok(x + 1, y, c) && ok(x + 2, y, c)) {
      mark[x][y] = mark[x + 1][y] = mark[x + 2][y] = 1;
      s[x][y] = s[x + 1][y] = s[x + 2][y] = c;
      return true;
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    s.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'w') {
        if (horizon(i, j))
          ;
        else if (vertical(i, j))
          ;
        else
          return cout << "NO\n", 0;
      }
    }
  }
  cout << "YES\n";
  for (auto x : s) cout << x << "\n";
}
