#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c;
  cin >> r >> c;
  getchar();
  char str[600][600];
  bool w = false;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cin >> str[i][j];
      if (str[i][j] == 'W') w = true;
    }
  }
  bool protect = true;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (str[i][j] == 'S') {
        if (j != c - 1) {
          if (str[i][j + 1] == 'W') {
            protect = false;
            break;
          }
          if (str[i][j + 1] == '.') {
            str[i][j + 1] = 'D';
          }
        }
        if (j != 0) {
          if (str[i][j - 1] == 'W') {
            protect = false;
            break;
          }
          if (str[i][j - 1] == '.') {
            str[i][j - 1] = 'D';
          }
        }
        if (i != r - 1) {
          if (str[i + 1][j] == 'W') {
            protect = false;
            break;
          }
          if (str[i + 1][j] == '.') {
            str[i + 1][j] = 'D';
          }
        }
        if (i != 0) {
          if (str[i - 1][j] == 'W') {
            protect = false;
            break;
          }
          if (str[i - 1][j] == '.') {
            str[i - 1][j] = 'D';
          }
        }
      }
    }
    if (protect == false) {
      break;
    }
  }
  if (protect == false) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cout << str[i][j];
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}
