#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000][1000], b[1000][1000];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      char ch;
      cin >> ch;
      if (ch == 'w') a[i][j] = 1;
      if (ch == 'b') a[i][j] = 2;
      if (ch == '.') a[i][j] = 0;
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (i > 0 && i < n - 1 && a[i][j] == 2 && a[i - 1][j] == 1 &&
          a[i + 1][j] == 1 && b[i - 1][j] + b[i][j] + b[i + 1][j] == 0) {
        int k;
        for (k = 1; k < 5; k++)
          if ((i >= 2 && b[i - 2][j] == k) ||
              (i <= n - 3 && b[i + 2][j] == k) ||
              (j >= 1 && b[i][j - 1] == k) || (j < m - 1 && b[i][j + 1] == k))
            continue;
          else
            break;
        if (k == 5) {
          cout << "NO";
          return 0;
        }
        b[i - 1][j] = b[i][j] = b[i + 1][j] = k;
      }
      if (j > 0 && j < m - 1 && a[i][j] == 2 && a[i][j - 1] == 1 &&
          a[i][j + 1] == 1 && b[i][j - 1] + b[i][j] + b[i][j + 1] == 0) {
        int k;
        for (k = 1; k < 5; k++)
          if ((j >= 2 && b[i][j - 2] == k) ||
              (j <= m - 3 && b[i][j + 2] == k) ||
              (i >= 1 && b[i - 1][j] == k) || (i < n - 1 && b[i + 1][j] == k))
            continue;
          else
            break;
        if (k == 5) {
          cout << "NO";
          return 0;
        }
        b[i][j - 1] = b[i][j] = b[i][j + 1] = k;
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] && !b[i][j]) {
        cout << "NO";
        return 0;
      }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      if (!b[i][j])
        cout << '.';
      else
        cout << char('a' + b[i][j] - 1);
    cout << endl;
  }
  return 0;
}
