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