#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  string s[n];
  bool b = true;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'W') {
        if ((i - 1 >= 0 && s[i - 1][j] == 'S') ||
            (i + 1 < n && s[i + 1][j] == 'S') ||
            (j - 1 >= 0 && s[i][j - 1] == 'S') ||
            (j + 1 < m && s[i][j + 1] == 'S')) {
          b = false;
          break;
        }
      } else if (s[i][j] == '.')
        s[i][j] = 'D';
    }
  if (b) {
    cout << "Yes\n";
    for (int i = 0; i < n; i++) cout << s[i] << endl;
  } else
    cout << "No\n";
}
