#include <bits/stdc++.h>
using namespace std;
void speedup() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
long long expo(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b % 2 == 1) res = (res * a) % m;
    a = (a * a) % m;
    b /= 2;
  }
  return res;
}
int main() {
  long long n, m, i, j, flag = 0;
  cin >> n >> m;
  string s[n + 2];
  for (i = 0; i <= n - 1; i++) cin >> s[i];
  for (i = 0; i <= n - 1; i++) {
    for (j = 0; j <= m - 1; j++) {
      if (s[i][j] == 'S') {
        if (j - 1 >= 0) {
          if (s[i][j - 1] == 'W') {
            flag = 1;
            break;
          } else if (s[i][j - 1] == '.')
            s[i][j - 1] = 'D';
        }
        if (j + 1 < m) {
          if (s[i][j + 1] == 'W') {
            flag = 1;
            break;
          } else if (s[i][j + 1] == '.')
            s[i][j + 1] = 'D';
        }
        if (i - 1 >= 0) {
          if (s[i - 1][j] == 'W') {
            flag = 1;
            break;
          } else if (s[i - 1][j] == '.')
            s[i - 1][j] = 'D';
        }
        if (i + 1 < n) {
          if (s[i + 1][j] == 'W') {
            flag = 1;
            break;
          } else if (s[i + 1][j] == '.')
            s[i + 1][j] = 'D';
        }
      } else if (s[i][j] == '.')
        s[i][j] = 'D';
    }
  }
  if (flag == 1)
    cout << "No";
  else {
    cout << "Yes" << endl;
    for (i = 0; i <= n - 1; i++) cout << s[i] << endl;
  }
}
