#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> vs;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    vs.push_back(s);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vs[i][j] == 'S') {
        if (i > 0) {
          if (vs[i - 1][j] != 'W') {
            if (vs[i - 1][j] != 'S') vs[i - 1][j] = 'D';
          } else {
            cout << "No"
                 << "\n";
            return 0;
          }
        }
        if (i < n - 1) {
          if (vs[i + 1][j] != 'W') {
            if (vs[i + 1][j] != 'S') vs[i + 1][j] = 'D';
          } else {
            cout << "No"
                 << "\n";
            return 0;
          }
        }
        if (j > 0) {
          if (vs[i][j - 1] != 'W') {
            if (vs[i][j - 1] != 'S') vs[i][j - 1] = 'D';
          } else {
            cout << "No"
                 << "\n";
            return 0;
          }
        }
        if (j < m - 1) {
          if (vs[i][j + 1] != 'W') {
            if (vs[i][j + 1] != 'S') vs[i][j + 1] = 'D';
          } else {
            cout << "No"
                 << "\n";
            return 0;
          }
        }
      }
    }
  }
  cout << "Yes"
       << "\n";
  for (int i = 0; i < n; i++) {
    cout << vs[i] << "\n";
  }
}
