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