#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n, m;
int color[maxn][maxn];
char a[maxn][maxn];
inline int col(int i, int j) {
  if (i < 0 || i >= n || j < 0 || j >= m) return 0;
  return color[i][j];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] == 'w' && !color[i][j]) {
        bool ok = 0, ok1 = 0;
        if (j + 1 < m && a[i][j + 1] == 'b' && !color[i][j + 1]) ok = 1;
        if (i + 1 < n && a[i + 1][j] == 'b' && !color[i + 1][j]) ok1 = 1;
        if (ok) {
          if (j + 2 < m && a[i][j + 2] == 'w' && !color[i][j + 2]) {
            set<int> l;
            l.insert(col(i - 1, j + 1));
            l.insert(col(i, j - 1));
            l.insert(col(i, j + 3));
            for (int h = 1; h < 5; h++)
              if (l.find(h) == l.end()) {
                for (int k = j; k < j + 3; k++) color[i][k] = h;
                break;
              }
          } else {
            cout << "NO" << endl;
            return 0;
          }
        } else if (ok1) {
          if (i + 2 < n && a[i + 2][j] == 'w' && !color[i + 2][j]) {
            set<int> l;
            l.insert(col(i, j - 1));
            l.insert(col(i - 1, j));
            l.insert(col(i, j + 1));
            for (int h = 1; h < 5; h++)
              if (l.find(h) == l.end()) {
                for (int k = i; k < i + 3; k++) color[k][j] = h;
                break;
              }
          } else {
            cout << "NO" << endl;
            return 0;
          }
        } else {
          cout << "NO" << endl;
          return 0;
        }
      } else if (a[i][j] == 'b' && !color[i][j]) {
        cout << "NO" << endl;
        return 0;
      }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      if (color[i][j])
        cout << (char)('a' + color[i][j] - 1);
      else
        cout << a[i][j];
    cout << endl;
  }
  return 0;
}
