#include <bits/stdc++.h>
int n, m;
char map[1010][1010], ans[1010][1010];
bool s[200];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", map[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (map[i][j] == 'w') {
        if (map[i][j + 1] == 'b') {
          if (map[i][j + 2] == 'w') {
            s[1] = s[2] = s[3] = s[4] = false;
            s[(int)map[i][j - 1]] = s[(int)map[i - 1][j]] =
                s[(int)map[i - 1][j + 1]] = s[(int)map[i - 1][j + 2]] =
                    s[(int)map[i][j + 3]] = true;
            int t = 1;
            for (; t < 5; t++)
              if (!s[t]) break;
            if (t == 5) {
              printf("NO");
              return 0;
            }
            map[i][j] = map[i][j + 1] = map[i][j + 2] = t;
          } else {
            printf("NO");
            return 0;
          }
        } else if (map[i + 1][j] == 'b' && map[i + 2][j] == 'w') {
          s[1] = s[2] = s[3] = s[4] = false;
          s[(int)map[i][j - 1]] = s[(int)map[i + 1][j - 1]] =
              s[(int)map[i + 2][j - 1]] = s[(int)map[i - 1][j]] =
                  s[(int)map[i][j + 1]] = s[(int)map[i + 1][j + 1]] = true;
          int t = 1;
          for (; t < 5; t++)
            if (!s[t]) break;
          if (t == 5) {
            printf("NO");
            return 0;
          }
          map[i][j] = map[i + 1][j] = map[i + 2][j] = t;
        } else {
          printf("NO");
          return 0;
        }
      } else if (map[i][j] == 'b') {
        printf("NO");
        return 0;
      }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (map[i][j] >= 1 && map[i][j] <= 4) map[i][j] += 'a' - 1;
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%s\n", map[i] + 1);
}
