#include <bits/stdc++.h>
using namespace std;
string a[510];
int main() {
  int r, c;
  cin >> r >> c;
  for (int i = (0); i < (r); ++i) {
    cin >> a[i];
  }
  for (int i = (0); i < (r); ++i) {
    for (int j = (0); j < (a[i].size()); ++j) {
      if (a[i][j] == '.') a[i][j] = 'D';
    }
  }
  for (int i = (0); i < (r); ++i) {
    for (int j = (0); j < (a[i].size()); ++j) {
      if (a[i][j] == 'S') {
        if (i - 1 >= 0 && a[i - 1][j] == 'W') {
          cout << "No" << endl;
          return 0;
        }
        if (i + 1 < r && a[i + 1][j] == 'W') {
          cout << "No" << endl;
          return 0;
        }
        if (j - 1 >= 0 && a[i][j - 1] == 'W') {
          cout << "No" << endl;
          return 0;
        }
        if (j + 1 < a[i].size() && a[i][j + 1] == 'W') {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = (0); i < (r); ++i) {
    for (int j = (0); j < (a[i].size()); ++j) {
      cout << a[i][j];
    }
    cout << endl;
  }
  return 0;
}
