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