#include <bits/stdc++.h>
using namespace std;
const int O = 1e6 + 6;
const int Pr = 2750140;
const int T = 2e3 + 3;
const int Quao = 1e5 + 5;
const long long INF = 1e18;
char a[T][T];
map<long long, int> cnt;
vector<int> x;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  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 flag = 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 + 1][j] == 'W' || a[i][j - 1] == 'W' ||
            a[i][j + 1] == 'W') {
          flag = false;
          break;
        }
      }
    }
    if (!flag) break;
  }
  if (!flag)
    cout << "No\n";
  else {
    cout << "Yes\n";
    for (int i = 1; i <= r; ++i)
      for (int j = 1; j <= c; ++j) {
        if (a[i][j] == 'S') {
          if (a[i + 1][j] == '.') a[i + 1][j] = 'D';
          if (a[i - 1][j] == '.') a[i - 1][j] = 'D';
          if (a[i][j - 1] == '.') a[i][j - 1] = 'D';
          if (a[i][j + 1] == '.') a[i][j + 1] = 'D';
        }
      }
    for (int i = 1; i <= r; ++i) {
      for (int j = 1; j <= c; ++j) cout << a[i][j];
      cout << "\n";
    }
  }
}
