#include <bits/stdc++.h>
using namespace std;
char a[555][555];
int main() {
  int j, i, n, m;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  int jud = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (a[i][j] == 'S') {
        if (i > 0) {
          if (a[i - 1][j] == 'W')
            jud = 1;
          else if (a[i - 1][j] == '.')
            a[i - 1][j] = 'D';
        }
        if (j > 0) {
          if (a[i][j - 1] == 'W')
            jud = 1;
          else if (a[i][j - 1] == '.')
            a[i][j - 1] = 'D';
        }
        if (i < n) {
          if (a[i + 1][j] == 'W')
            jud = 1;
          else if (a[i + 1][j] == '.')
            a[i + 1][j] = 'D';
        }
        if (j < m) {
          if (a[i][j + 1] == 'W')
            jud = 1;
          else if (a[i][j + 1] == '.')
            a[i][j + 1] = 'D';
        }
      }
    }
  }
  if (jud)
    cout << "No";
  else {
    cout << "Yes" << endl;
    for (i = 0; i < n; i++) cout << a[i] << endl;
  }
}
