#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c;
  cin >> r >> c;
  char a[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 - 1 >= 0 && a[i - 1][j] == '.') a[i - 1][j] = 'D';
        if (i + 1 < r && a[i + 1][j] == '.') a[i + 1][j] = 'D';
        if (j - 1 >= 0 && a[i][j - 1] == '.') a[i][j - 1] = 'D';
        if (j + 1 < c && a[i][j + 1] == '.') a[i][j + 1] = 'D';
      }
    }
  }
  bool f = true;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (a[i][j] == 'S') {
        if (i - 1 >= 0 && a[i - 1][j] == 'W') f = false;
        if (i + 1 < r && a[i + 1][j] == 'W') f = false;
        if (j - 1 >= 0 && a[i][j - 1] == 'W') f = false;
        if (j + 1 < c && a[i][j + 1] == 'W') f = false;
      }
    }
  }
  if (f == false)
    cout << "No" << endl;
  else {
    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;
}
