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