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