#include <bits/stdc++.h>
int N, M;
char a[1005][1005], b[1005][1005];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", a[i] + 1);
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) b[i][j] = '.';
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (a[i][j] == 'b') {
        int c = 97 + i % 2 * 2 + (i / 2 + j / 2) % 2;
        if (a[i - 1][j] == 'w' && a[i + 1][j] == 'w')
          b[i - 1][j] = b[i][j] = b[i + 1][j] = c,
                a[i - 1][j] = a[i][j] = a[i + 1][j] = '.';
        else if (a[i][j - 1] == 'w' && a[i][j + 1] == 'w')
          b[i][j - 1] = b[i][j] = b[i][j + 1] = c,
                   a[i][j - 1] = a[i][j] = a[i][j + 1] = '.';
      }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (a[i][j] != '.') return puts("NO"), 0;
  puts("YES");
  for (int i = 1; i <= N; i++) printf("%s\n", b[i] + 1);
}
