#include <bits/stdc++.h>
using namespace std;
char f[1111][1111];
bool black[1111][1111];
bool is_free(int i, int j) {
  return f[i][j] != '.' && (f[i][j] < 'a' || f[i][j] > 'd');
}
bool can_hor(int i, int j) {
  return (is_free(i, j) && is_free(i, j + 1) && is_free(i, j + 2)) &&
         !black[i][j] && black[i][j + 1] && !black[i][j + 2];
}
bool can_vec(int i, int j) {
  return (is_free(i, j) && is_free(i + 1, j) && is_free(i + 2, j)) &&
         !black[i][j] && black[i + 1][j] && !black[i + 2][j];
}
bool place_hor(int i, int j) {
  if (can_hor(i, j)) {
    char fr = 0;
    for (char cur = 'a'; cur <= 'd'; cur++) {
      bool can = true;
      for (int kj = j; kj <= j + 2; kj++) {
        if (f[i - 1][kj] == cur || f[i + 1][kj] == cur || f[i][j - 1] == cur ||
            f[i][j + 3] == cur) {
          can = false;
          break;
        }
      }
      if (can) {
        fr = cur;
        break;
      }
    }
    if (!fr) return false;
    for (int kj = j; kj <= j + 2; kj++) {
      f[i][kj] = fr;
    }
    return true;
  }
  return false;
}
bool place_vec(int i, int j) {
  if (can_vec(i, j)) {
    char fr = 0;
    for (char cur = 'a'; cur <= 'd'; cur++) {
      bool can = true;
      for (int ki = i; ki <= i + 2; ki++) {
        if (f[ki][j - 1] == cur || f[ki][j + 1] == cur || f[i - 1][j] == cur ||
            f[i + 3][j] == cur) {
          can = false;
          break;
        }
      }
      if (can) {
        fr = cur;
        break;
      }
    }
    if (!fr) return false;
    for (int ki = i; ki <= i + 2; ki++) {
      f[ki][j] = fr;
    }
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  memset(f, '.', sizeof(f));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> f[i][j];
      if (f[i][j] == 'b')
        black[i][j] = 1;
      else if (f[i][j] == 'w')
        black[i][j] = 0;
      if (f[i][j] != '.') f[i][j] = ' ';
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!is_free(i, j)) continue;
      if (!place_hor(i, j)) {
        if (!place_vec(i, j)) {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << f[i][j];
    }
    cout << endl;
  }
  return 0;
}
