#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c;
  cin >> r >> c;
  char a;
  vector<vector<char> > V(r, vector<char>(c));
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cin >> a;
      V[i][j] = a;
    }
  }
  int p = 0;
  for (int i = 0; i < r and p == 0; i++) {
    for (int j = 0; j < c and p == 0; j++) {
      if (V[i][j] == 'S') {
        if (i > 0) {
          if (V[i - 1][j] == 'W')
            p = 1;
          else if (V[i - 1][j] != 'S')
            V[i - 1][j] = 'D';
        }
        if (j > 0) {
          if (V[i][j - 1] == 'W')
            p = 1;
          else if (V[i][j - 1] != 'S')
            V[i][j - 1] = 'D';
        }
        if (i < r - 1) {
          if (V[i + 1][j] == 'W')
            p = 1;
          else if (V[i + 1][j] != 'S')
            V[i + 1][j] = 'D';
        }
        if (j < c - 1) {
          if (V[i][j + 1] == 'W')
            p = 1;
          else if (V[i][j + 1] != 'S')
            V[i][j + 1] = 'D';
        }
      }
    }
  }
  if (p == 1)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cout << V[i][j];
      }
      cout << endl;
    }
  }
}
