#include <bits/stdc++.h>
using namespace std;
void myassert(bool expr) {
  if (!expr) abort();
}
const int64_t posinf = 9223372036854775807LL;
const int64_t neginf = 9223372036854775808LL;
const int64_t bigprime = (1LL << 61) - 1LL;
const int64_t mult = 199;
const int64_t mult2 = 3571;
const int64_t mod = 1000000007LL;
const int64_t mod2 = 1000000009LL;
const long double pi = 3.1415926535897932384626433832795L;
template <typename T>
T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
char mtx[1024][1024];
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> mtx[i];
    for (int j = 0; j < m; j++)
      if (mtx[i][j] == 'b') mtx[i][j] = 'f';
  }
  char lets[4] = {'a', 'b', 'c', 'd'};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mtx[i][j] == 'f') {
        cout << "NO";
        return 0;
      }
      if (mtx[i][j] != 'w') continue;
      if (mtx[i][j + 1] == 'f' && mtx[i][j + 2] == 'w') {
        mtx[i][j] = mtx[i][j + 1] = mtx[i][j + 2] =
            lets[(i + (j + 1) / 2 * 2) % 4];
      } else if (mtx[i + 1][j] == 'f' && mtx[i + 2][j] == 'w') {
        mtx[i][j] = mtx[i + 1][j] = mtx[i + 2][j] =
            lets[(i + 1 + j / 2 * 2) % 4];
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (mtx[i][j] == 'f' || mtx[i][j] == 'w') {
        cout << "NO";
        return 0;
      }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << mtx[i] << endl;
  return 0;
}
