#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 10;
int mapp[maxn][maxn];
int movex[4] = {0, 0, 1, -1};
int movey[4] = {1, -1, 0, 0};
char labels[4] = {'.', 'S', 'D', 'W'};
int main() {
  int r, c;
  while (cin >> r >> c) {
    memset(mapp, -1, sizeof mapp);
    for (int i = 0; i < r; ++i) {
      for (int j = 0; j < c; ++j) {
        char c;
        cin >> c;
        if (c == '.')
          mapp[i][j] = 0;
        else if (c == 'S')
          mapp[i][j] = 1;
        else if (c == 'D')
          mapp[i][j] = 2;
        else if (c == 'W')
          mapp[i][j] = 3;
      }
    }
    bool flag = false;
    for (int i = 0; i < r; ++i) {
      for (int j = 0; j < c; ++j) {
        if (mapp[i][j] == 1) {
          for (int k = 0; k < 4; ++k) {
            int curx = i + movex[k], cury = j + movey[k];
            if (curx >= r || curx < 0 || cury >= c || cury < 0) continue;
            if (mapp[curx][cury] == 3) {
              flag = true;
              break;
            }
            if (mapp[curx][cury] == 0) mapp[curx][cury] = 2;
          }
        }
      }
    }
    if (flag)
      cout << "No" << endl;
    else {
      cout << "Yes" << endl;
      for (int i = 0; i < r; ++i) {
        for (int j = 0; j < c; ++j) cout << labels[mapp[i][j]];
        cout << endl;
      }
    }
  }
  return 0;
}
