#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long mxn = 1e18;
set<long long>::iterator it;
int main() {
  long long r, c, i, s = 1, j;
  cin >> r >> c;
  vector<string> a(r);
  for (i = 0; i < r; i++) {
    cin >> a[i];
    for (j = 0; j < c; j++)
      if (a[i][j] == '.') a[i][j] = 'D';
  }
  for (i = 0; i < r; i++) {
    for (j = 0; j < c; j++) {
      if (a[i][j] == 'W') {
        if (i - 1 >= 0 && a[i - 1][j] == 'S') s = 0;
        if (j - 1 >= 0 && a[i][j - 1] == 'S') s = 0;
        if (i + 1 < r && a[i + 1][j] == 'S') s = 0;
        if (j + 1 < c && a[i][j + 1] == 'S') s = 0;
      }
    }
  }
  if (!s)
    cout << "No\n";
  else {
    cout << "Yes\n";
    for (i = 0; i < r; i++) cout << a[i] << endl;
  }
}
