#include <bits/stdc++.h>
using namespace std;
char area[1000][1000];
int main() {
  int r, c;
  cin >> r >> c;
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      cin >> area[i][j];
    }
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (area[i][j] == 'S') {
        if (area[i][j - 1] == 'W' || area[i][j + 1] == 'W' ||
            area[i - 1][j] == 'W' || area[i + 1][j] == 'W') {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes\n";
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (area[i][j] == '.') {
        cout << 'D';
      } else
        cout << area[i][j];
      if (j == c && i != r) cout << "\n";
    }
  }
}
