#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, n, m, i, j, k, a[100001];
  string s[501];
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    for (j = 0; j < m; j++)
      if (s[i][j] == '.') s[i][j] = 'D';
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (s[i][j] != 'S') continue;
      if (i > 0 and s[i - 1][j] == 'W') {
        cout << "No";
        return (0);
      }
      if (i < n and s[i + 1][j] == 'W') {
        cout << "No";
        return (0);
      }
      if (j > 0 and s[i][j - 1] == 'W') {
        cout << "No";
        return (0);
      }
      if (j < m and s[i][j + 1] == 'W') {
        cout << "No";
        return (0);
      }
    }
  }
  cout << "Yes" << endl;
  for (i = 0; i < n; i++) cout << s[i] << endl;
}
