#include <bits/stdc++.h>
using namespace std;
char s[1100][1100];
int use[1100][1100];
int vis[10];
int wayx[10] = {-1, 0, 0, 1};
int wayy[10] = {0, -1, 1, 0};
int n, m;
void gao(int x, int y) {
  for (int i = 0; i < 4; i++) {
    int tx = x + wayx[i];
    int ty = y + wayy[i];
    if (tx < 0 || tx >= n) continue;
    if (ty < 0 || ty >= m) continue;
    if (!use[tx][ty]) continue;
    vis[use[tx][ty]] = 1;
  }
}
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) scanf("%s", s[i]);
    memset(use, 0, sizeof(use));
    bool yes = true;
    for (int i = 0; i < n && yes; i++)
      for (int j = 0; j < m && yes; j++) {
        if (s[i][j] == '.') continue;
        if (use[i][j]) continue;
        if (s[i][j] == 'b') {
          yes = false;
          break;
        }
        if (s[i][j + 1] == 'b' && !use[i][j + 1]) {
          if (j + 2 >= m) {
            yes = false;
            break;
          }
          memset(vis, 0, sizeof(vis));
          for (int k = j; k < j + 3; k++) gao(i, k);
          int ans = 0;
          for (int k = 1; k <= 4; k++)
            if (!vis[k]) {
              ans = k;
              break;
            }
          for (int k = j; k < j + 3; k++) use[i][k] = ans;
        } else {
          if (i + 2 >= n) {
            yes = false;
            break;
          }
          memset(vis, 0, sizeof(vis));
          for (int k = i; k < i + 3; k++) gao(k, j);
          int ans = 0;
          for (int k = 1; k <= 4; k++)
            if (!vis[k]) {
              ans = k;
              break;
            }
          for (int k = i; k < i + 3; k++) use[k][j] = ans;
        }
      }
    if (!yes) {
      puts("NO");
    } else {
      puts("YES");
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++)
          if (s[i][j] == '.')
            printf(".");
          else
            printf("%c", use[i][j] + 'a' - 1);
        printf("\n");
      }
    }
  }
  return 0;
}
