#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, m, n, a[55556], b[5555], c[22222], d, e, f[234567], s, t;
pair<long long, long long> x[123456];
map<long long, long long> y;
string p[1111];
string q, r[1111];
int main() {
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (p[i][j] == 'S') {
        if ((i + 1 < n && p[i + 1][j] == 'W') ||
            (i > 0 && p[i - 1][j] == 'W') || (j > 0 && p[i][j - 1] == 'W') ||
            (j + 1 < m && p[i][j + 1] == 'W')) {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (p[i][j] == '.')
        cout << 'D';
      else
        cout << p[i][j];
    }
    cout << endl;
  }
  return 0;
}
