Problem: There are many interesting tasks on domino tilings. For example, an interesting fact is known. Let us take a standard chessboard (8 × 8) and cut exactly two squares out of it. It turns out that the resulting board can always be tiled using dominoes 1 × 2, if the two cut out squares are of the same color, otherwise it is impossible. 

Petya grew bored with dominoes, that's why he took a chessboard (not necessarily 8 × 8), cut some squares out of it and tries to tile it using triminoes. Triminoes are reactangles 1 × 3 (or 3 × 1, because triminoes can be rotated freely), also the two extreme squares of a trimino are necessarily white and the square in the middle is black. The triminoes are allowed to put on the chessboard so that their squares matched the colors of the uncut squares of the chessboard, and also the colors must match: the black squares must be matched with the black ones only and the white ones — with the white squares. The triminoes must not protrude above the chessboard or overlap each other. All the uncut squares of the board must be covered with triminoes. 

Help Petya find out if it is possible to tile his board using triminos in the described way and print one of the variants of tiling.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 1000) — the board size. Next n lines contain m symbols each and represent the board description. If some position contains ".", then the square in this position has been cut out. Symbol "w" stands for a white square, "b" stands for a black square. It is guaranteed that through adding the cut squares can result in a correct chessboard (i.e. with alternating black and white squares), thought, perhaps, of a non-standard size.

Output

If at least one correct tiling exists, in the first line print "YES" (without quotes), and then — the tiling description. The description must contain n lines, m symbols in each. The cut out squares, as well as in the input data, are marked by ".". To denote triminoes symbols "a", "b", "c", "d" can be used, and all the three squares of each trimino must be denoted by the same symbol. If two triminoes share a side, than they must be denoted by different symbols. Two triminoes not sharing a common side can be denoted by one and the same symbol (c.f. sample).

If there are multiple correct ways of tiling, it is allowed to print any. If it is impossible to tile the board using triminoes or the correct tiling, for which four symbols "a", "b", "c", "d" would be enough, doesn't exist, print "NO" (without quotes) in the first line.

Examples

Input

6 10
.w.wbw.wbw
wbwbw.w.w.
bw.wbwbwbw
w.wbw.wbwb
...wbw.w.w
..wbw.wbw.


Output

YES
.a.aaa.ccc
baccc.c.a.
ba.dddcbab
b.aaa.cbab
...bbb.b.b
..ccc.ddd.

Input

2 2
wb
bw


Output

NO


Input

1 3
wbw


Output

YES
bbb


Input

1 3
...


Output

YES
...

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MN = 1100;
const int MM = 2100000;
int n, m, nb, nw;
vector<int> l[MM], l2[MM];
int vz[MM];
int td[MM][2];
int ind[MM];
char jd[MN][MN];
char C[MN][MN];
int ed[10000000][2];
int que[MM];
int ef;
int Con;
int mk[4];
int mark[MM];
int dfs(int x) {
  mark[x] = 1;
  for (int i = 0; i < l[x].size(); i++) {
    if (!mark[l[x][i]]) {
      dfs(l[x][i]);
    }
  }
  que[ef++] = x;
}
int ok(int x, int y) { return 0 <= x && x < n && 0 <= y && y < m; }
int dfs2(int x) {
  mark[x] = Con;
  for (int i = 0; i < l2[x].size(); i++) {
    if (!mark[l2[x][i]]) {
      dfs2(l2[x][i]);
    }
  }
}
int wc(int x, int y) {
  if (ok(x - 1, y) && C[x - 1][y] != '.') {
    mk[C[x - 1][y] - 'a'] = 1;
  }
  if (ok(x + 1, y) && C[x + 1][y] != '.') {
    mk[C[x + 1][y] - 'a'] = 1;
  }
  if (ok(x, y - 1) && C[x][y - 1] != '.') {
    mk[C[x][y - 1] - 'a'] = 1;
  }
  if (ok(x, y + 1) && C[x][y + 1] != '.') {
    mk[C[x][y + 1] - 'a'] = 1;
    ;
  }
}
int Num(int x, int y) { return x * m + y + 1; }
int nt(int x) {
  if (x < 0) {
    x *= -1;
    x--;
    return 2 * ind[x];
  } else {
    x--;
    return 2 * ind[x] + 1;
  }
}
int t(int x) {
  if (x < 0) {
    x *= -1;
    x--;
    return 2 * ind[x] + 1;
  } else {
    x--;
    return 2 * ind[x];
  }
}
int mv[8][2];
int main() {
  mv[0][0] = -1;
  mv[0][1] = -1;
  mv[1][0] = 1;
  mv[1][1] = 1;
  mv[2][0] = -1;
  mv[2][1] = 1;
  mv[3][0] = 1;
  mv[3][1] = -1;
  mv[4][0] = -2;
  mv[4][1] = 0;
  mv[5][0] = 2;
  mv[5][1] = 0;
  mv[6][0] = 0;
  mv[6][1] = -2;
  mv[7][0] = 0;
  mv[7][1] = 2;
  int con = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      scanf(" %c", &c);
      jd[i][j] = c;
      if (jd[i][j] == 'b') {
        ind[i * m + j] = con++;
      }
      if (jd[i][j] == 'b') {
        nb++;
      }
      if (jd[i][j] == 'w') {
        nw++;
      }
    }
  }
  if (nw != nb * 2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int nm = Num(i, j);
      if (jd[i][j] == 'b') {
        if (j > 0 && j < m - 1 && jd[i][j - 1] == 'w' && jd[i][j + 1] == 'w') {
          td[nm][0] = 1;
        }
        if (i > 0 && i < n - 1 && jd[i - 1][j] == 'w' && jd[i + 1][j] == 'w') {
          td[nm][1] = 1;
        }
        if (td[nm][0] == 1 && td[nm][1] == 0) {
          ed[ef][0] = -(nm);
          ed[ef++][1] = -(nm);
        }
        if (td[nm][1] == 1 && td[nm][0] == 0) {
          ed[ef][0] = (nm);
          ed[ef++][1] = (nm);
        }
        if (td[nm][0] == 0 && td[nm][1] == 0) {
          cout << "NO" << endl;
          return 0;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int nm = Num(i, j);
      if (jd[i][j] == 'b') {
        int x = i, y = j;
        for (int r = 0; r < 8; r++) {
          int xp = x + mv[r][0], yp = y + mv[r][1];
          if (ok(xp, yp) && jd[xp][yp] == 'b') {
            int nm2 = Num(xp, yp);
            if (r < 4) {
              ed[ef][0] = nm;
              ed[ef++][1] = -nm2;
              ed[ef][0] = -nm;
              ed[ef++][1] = nm2;
            } else {
              if (r < 6) {
                ed[ef][0] = -nm;
                ed[ef++][1] = -nm2;
              } else {
                ed[ef][0] = nm;
                ed[ef++][1] = nm2;
              }
            }
          }
        }
      }
    }
  }
  for (int i = 0; i < ef; i++) {
    int x = ed[i][0];
    int y = ed[i][1];
    l[nt(x)].push_back(t(y));
    l[nt(y)].push_back(t(x));
    l2[t(y)].push_back(nt(x));
    l2[t(x)].push_back(nt(y));
  }
  ef = 0;
  for (int i = 0; i < nb * 2; i++) {
    if (!mark[i]) {
      dfs(i);
    }
  }
  Con = 1;
  memset(mark, 0, sizeof(mark));
  for (int i = ef - 1; i >= 0; i--) {
    if (!mark[que[i]]) {
      dfs2(que[i]);
      Con++;
    }
  }
  for (int i = 0; i < nb * 2; i += 2) {
    if (mark[i] == mark[i + 1]) {
      cout << "NO" << endl;
      return 0;
    } else {
      if (mark[i] > mark[i + 1]) {
        vz[i / 2] = 1;
      } else {
        vz[i / 2] = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      C[i][j] = '.';
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (jd[i][j] == 'b') {
        mk[0] = mk[1] = mk[2] = mk[3] = 0;
        if (vz[ind[i * m + j]] == 1) {
          max(max(wc(i, j), wc(i - 1, j)), wc(i + 1, j));
          int r = -1;
          for (int i = 0; i < 4; i++) {
            if (mk[i] == 0) {
              r = i;
              break;
            }
          }
          if (r == -1) {
            while (true) {
              r++;
            }
            cout << "NO" << endl;
            return 0;
          }
          C[i][j] = r + 'a';
          C[i - 1][j] = C[i][j];
          C[i + 1][j] = C[i][j];
        } else {
          C[i][j] = max(max(wc(i, j), wc(i, j - 1)), wc(i, j + 1));
          int r = -1;
          for (int i = 0; i < 4; i++) {
            if (mk[i] == 0) {
              r = i;
              break;
            }
          }
          if (r == -1) {
            while (true) {
              r++;
            }
            return 1;
            cout << "NO" << endl;
            return 0;
          }
          C[i][j] = r + 'a';
          C[i][j + 1] = C[i][j];
          C[i][j - 1] = C[i][j];
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << C[i][j];
    }
    cout << endl;
  }
}