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;
long long i, j, n, m, e, ch = 0, be = 0, x1, x2, x3, x4;
char p[1003][1003];
vector<vector<char> > a;
vector<vector<long long> > b, c, ot;
vector<long long> y;
vector<char> q;
vector<char> o;
queue<pair<long long, long long> > w;
char r;
long long vo1(long long l, long long r) {
  if (c[l][r] == 0) {
    if (a[l][r] == 'w') {
      if (b[l][r] == 4) {
        cout << "NO";
        exit(0);
      }
      if (b[l][r] < 3)
        w.push(make_pair(l, r));
      else {
        if (l > 2 && a[l - 1][r] == 'b' && a[l - 2][r] == 'w' &&
            c[l - 1][r] == 0) {
          e++;
          c[l][r] = e;
          c[l - 1][r] = e;
          c[l - 2][r] = e;
          b[l - 3][r]++;
          b[l - 2][r - 1]++;
          b[l - 2][r + 1]++;
          b[l - 1][r - 1]++;
          b[l - 1][r + 1]++;
          b[l][r - 1]++;
          b[l][r + 1]++;
          b[l + 1][r]++;
        } else if (l + 2 <= n && a[l + 1][r] == 'b' && a[l + 2][r] == 'w' &&
                   c[l + 1][r] == 0) {
          e++;
          c[l][r] = e;
          c[l + 1][r] = e;
          c[l + 2][r] = e;
          b[l - 1][r]++;
          b[l + 3][r]++;
          b[l][r - 1]++;
          b[l][r + 1]++;
          b[l + 1][r - 1]++;
          b[l + 1][r + 1]++;
          b[l + 2][r - 1]++;
          b[l + 2][r + 1]++;
        } else if (r > 2 && a[l][r - 1] == 'b' && a[l][r - 2] == 'w' &&
                   c[l][r - 1] == 0) {
          e++;
          c[l][r] = e;
          c[l][r - 1] = e;
          c[l][r - 2] = e;
          b[l][r + 1]++;
          b[l][r - 3]++;
          b[l + 1][r]++;
          b[l + 1][r - 1]++;
          b[l + 1][r - 2]++;
          b[l - 1][r]++;
          b[l - 1][r - 1]++;
          b[l - 1][r - 2]++;
        } else if (r + 2 <= m && a[l][r + 1] == 'b' && a[l][r + 2] == 'w' &&
                   c[l][r + 1] == 0) {
          e++;
          c[l][r] = e;
          c[l][r + 1] = e;
          c[l][r + 2] = e;
          b[l][r - 1]++;
          b[l][r + 3]++;
          b[l - 1][r]++;
          b[l - 1][r + 1]++;
          b[l - 1][r + 2]++;
          b[l + 1][r]++;
          b[l + 1][r + 1]++;
          b[l + 1][r + 2]++;
        } else {
          cout << "NO";
          exit(0);
        }
      }
    } else if (a[l][r] == 'b') {
      if (b[l][r] > 2) {
        cout << "NO";
        exit(0);
      } else if (b[l][r] < 2)
        w.push(make_pair(l, r));
      else {
        if (l > 1 && l < n && a[l - 1][r] == 'w' && a[l + 1][r] == 'w' &&
            b[l - 1][r] == 0 && b[l + 1][r] == 0) {
          e++;
          c[l][r] = e;
          c[l - 1][r] = e;
          c[l + 1][r] = e;
          b[l - 2][r]++;
          b[l + 2][r]++;
          b[l - 1][r - 1]++;
          b[l - 1][r + 1]++;
          b[l][r - 1]++;
          b[l][r + 1]++;
          b[l + 1][r - 1]++;
          b[l + 1][r + 1]++;
        } else if (r > 1 && r < m && a[l][r - 1] == 'w' && a[l][r + 1] == 'w' &&
                   b[l][r - 1] == 0 && b[l][r + 1] == 0) {
          e++;
          c[l][r] = e;
          c[l][r - 1] = e;
          c[l][r + 1] = e;
          b[l][r - 2]++;
          b[l][r + 2]++;
          b[l - 1][r]++;
          b[l - 1][r - 1]++;
          b[l - 1][r + 1]++;
          b[l + 1][r - 1]++;
          b[l + 1][r]++;
          b[l + 1][r + 1]++;
        } else {
          cout << "NO";
          exit(0);
        }
      }
    }
  }
}
int main() {
  cin >> n >> m;
  for (i = 0; i <= n + 1; i++) {
    a.push_back(q);
    b.push_back(y);
    c.push_back(y);
  }
  for (i = 0; i <= m + 1; i++) {
    a[0].push_back('.');
    a[n + 1].push_back('.');
    b[0].push_back(-1);
    b[n + 1].push_back(-1);
    c[0].push_back(1);
    c[n + 1].push_back(1);
  }
  for (i = 1; i <= n; i++) {
    a[i].push_back('.');
    b[i].push_back(-1);
    c[i].push_back(1000005);
    for (j = 1; j <= m; j++) {
      cin >> r;
      a[i].push_back(r);
      b[i].push_back(0);
      c[i].push_back(0);
      if (r == 'w')
        be++;
      else if (r == 'b')
        ch++;
    }
    a[i].push_back('.');
    b[i].push_back(-1);
    c[i].push_back(1000005);
  }
  ot = c;
  if (ch * 2 != be) {
    cout << "NO";
    return 0;
  }
  e = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (a[i - 1][j] == '.') b[i][j]++;
      if (a[i + 1][j] == '.') b[i][j]++;
      if (a[i][j + 1] == '.') b[i][j]++;
      if (a[i][j - 1] == '.') b[i][j]++;
      if (b[i][j] == 4 && a[i][j] != '.') {
        cout << "NO";
        return 0;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (b[i][j] == 3 && a[i][j] != '.') {
        if (a[i][j] == 'b') {
          cout << "NO";
          return 0;
        }
        if (c[i][j] == 0) vo1(i, j);
      } else if (a[i][j] != '.')
        vo1(i, j);
    }
  }
  while (!w.empty()) {
    vo1(w.front().first, w.front().second);
    w.pop();
  }
  cout << "YES" << endl;
  for (i = 0; i < 1000010; i++) o.push_back('.');
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (a[i][j] == '.')
        p[i][j] = '.';
      else {
        if (o[c[i][j]] != '.')
          p[i][j] = o[c[i][j]];
        else if (j + 2 <= m && c[i][j] == c[i][j + 1] &&
                 c[i][j] == c[i][j + 2]) {
          x1 = 0;
          x2 = 0;
          x3 = 0;
          x4 = 0;
          if (o[c[i + 1][j]] == 'a' || o[c[i - 1][j]] == 'a' ||
              o[c[i + 1][j + 1]] == 'a' || o[c[i - 1][j + 1]] == 'a' ||
              o[c[i - 1][j + 2]] == 'a' || o[c[i + 1][j + 2]] == 'a' ||
              o[c[i][j + 3]] == 'a' || o[c[i][j - 1]] == 'a')
            x1 = 1;
          if (o[c[i + 1][j]] == 'b' || o[c[i - 1][j]] == 'b' ||
              o[c[i + 1][j + 1]] == 'b' || o[c[i - 1][j + 1]] == 'b' ||
              o[c[i - 1][j + 2]] == 'b' || o[c[i + 1][j + 2]] == 'b' ||
              o[c[i][j + 3]] == 'b' || o[c[i][j - 1]] == 'b')
            x2 = 1;
          if (o[c[i + 1][j]] == 'c' || o[c[i - 1][j]] == 'c' ||
              o[c[i + 1][j + 1]] == 'c' || o[c[i - 1][j + 1]] == 'c' ||
              o[c[i - 1][j + 2]] == 'c' || o[c[i + 1][j + 2]] == 'c' ||
              o[c[i][j + 3]] == 'c' || o[c[i][j - 1]] == 'c')
            x3 = 1;
          if (o[c[i + 1][j]] == 'd' || o[c[i - 1][j]] == 'd' ||
              o[c[i + 1][j + 1]] == 'd' || o[c[i - 1][j + 1]] == 'd' ||
              o[c[i - 1][j + 2]] == 'd' || o[c[i + 1][j + 2]] == 'd' ||
              o[c[i][j + 3]] == 'd' || o[c[i][j - 1]] == 'd')
            x4 = 1;
          if (x1 == 0) {
            o[c[i][j]] = 'a';
            p[i][j] = 'a';
            p[i][j + 1] = 'a';
            p[i][j + 2] = 'a';
          } else if (x2 == 0) {
            o[c[i][j]] = 'b';
            p[i][j] = 'b';
            p[i][j + 1] = 'b';
            p[i][j + 2] = 'b';
          } else if (x3 == 0) {
            o[c[i][j]] = 'c';
            p[i][j] = 'c';
            p[i][j + 1] = 'c';
            p[i][j + 2] = 'c';
          } else {
            o[c[i][j]] = 'd';
            p[i][j] = 'd';
            p[i][j + 1] = 'd';
            p[i][j + 2] = 'd';
          }
        }
        if (i + 2 <= n && c[i][j] == c[i + 1][j] && c[i][j] == c[i + 2][j]) {
          x1 = 0;
          x2 = 0;
          x3 = 0;
          x4 = 0;
          if (o[c[i - 1][j]] == 'a' || o[c[i + 3][j]] == 'a' ||
              o[c[i][j + 1]] == 'a' || o[c[i][j - 1]] == 'a' ||
              o[c[i + 1][j + 1]] == 'a' || o[c[i + 1][j - 1]] == 'a' ||
              o[c[i + 2][j - 1]] == 'a' || o[c[i + 2][j + 1]] == 'a')
            x1 = 1;
          if (o[c[i - 1][j]] == 'b' || o[c[i + 3][j]] == 'b' ||
              o[c[i][j + 1]] == 'b' || o[c[i][j - 1]] == 'b' ||
              o[c[i + 1][j + 1]] == 'b' || o[c[i + 1][j - 1]] == 'b' ||
              o[c[i + 2][j - 1]] == 'b' || o[c[i + 2][j + 1]] == 'b')
            x2 = 1;
          if (o[c[i - 1][j]] == 'c' || o[c[i + 3][j]] == 'c' ||
              o[c[i][j + 1]] == 'c' || o[c[i][j - 1]] == 'c' ||
              o[c[i + 1][j + 1]] == 'c' || o[c[i + 1][j - 1]] == 'c' ||
              o[c[i + 2][j - 1]] == 'c' || o[c[i + 2][j + 1]] == 'c')
            x3 = 1;
          if (o[c[i - 1][j]] == 'd' || o[c[i + 3][j]] == 'd' ||
              o[c[i][j + 1]] == 'd' || o[c[i][j - 1]] == 'd' ||
              o[c[i + 1][j + 1]] == 'd' || o[c[i + 1][j - 1]] == 'd' ||
              o[c[i + 2][j - 1]] == 'd' || o[c[i + 2][j + 1]] == 'd')
            x4 = 1;
          if (x1 == 0) {
            o[c[i][j]] = 'a';
            p[i][j] = 'a';
            p[i + 1][j] = 'a';
            p[i + 2][j] = 'a';
          } else if (x2 == 0) {
            o[c[i][j]] = 'b';
            p[i][j] = 'b';
            p[i + 1][j] = 'b';
            p[i + 2][j] = 'b';
          } else if (x3 == 0) {
            o[c[i][j]] = 'c';
            p[i][j] = 'c';
            p[i + 1][j] = 'c';
            p[i + 2][j] = 'c';
          } else {
            o[c[i][j]] = 'd';
            p[i][j] = 'd';
            p[i + 1][j] = 'd';
            p[i + 2][j] = 'd';
          }
        }
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cout << p[i][j];
    }
    cout << endl;
  }
  return 0;
}