#include <bits/stdc++.h>
using namespace std;
char ch[505][505];
void solve() {
  int r, c;
  cin >> r >> c;
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      cin >> ch[i][j];
    }
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (ch[i][j] == 'S') {
        if (ch[i - 1][j] == 'W' || ch[i + 1][j] == 'W' || ch[i][j + 1] == 'W' ||
            ch[i][j - 1] == 'W') {
          cout << "NO";
          return;
        }
      }
    }
  }
  cout << "Yes" << '\n';
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (ch[i][j] == '.')
        cout << "D";
      else
        cout << ch[i][j];
    }
    cout << '\n';
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
