#include <bits/stdc++.h>
using namespace std;
char c[505][505];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> c[i][j];
  int ok = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (c[i][j] == '.') c[i][j] = 'D';
      if (c[i][j] == 'W') {
        if (i > 1)
          if (c[i - 1][j] == 'S') ok = 1;
        if (i < n)
          if (c[i + 1][j] == 'S') ok = 1;
        if (j > 1)
          if (c[i][j - 1] == 'S') ok = 1;
        if (j < m)
          if (c[i][j + 1] == 'S') ok = 1;
      }
    }
  }
  if (ok == 1)
    cout << "No" << endl;
  else {
    cout << "Yes" << endl;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) cout << c[i][j];
      cout << endl;
    }
  }
  return 0;
}
