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