#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const double PI = 3.141592653589793238463;
using namespace std;
char a[505][505];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int r, c;
  cin >> r >> c;
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      cin >> a[i][j];
    }
  }
  bool ans = true;
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (a[i][j] == 'S') {
        if (a[i + 1][j] == 'W' || a[i][j - 1] == 'W' || a[i][j + 1] == 'W' ||
            a[i - 1][j] == 'W') {
          ans = false;
          break;
        }
      } else if (a[i][j] == '.')
        a[i][j] = 'D';
    }
  }
  if (!ans)
    cout << "No\n";
  else {
    cout << "Yes\n";
    for (int i = 1; i <= r; i++) {
      for (int j = 1; j <= c; j++) {
        cout << a[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}
