#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k, n, m, ans = 0, sum = 0, a[100005] = {0}, mn = 2e9, mx = 0,
                           x, y, z, cnt = 0;
  char c[550][550];
  cin >> n >> m;
  for (i = 0; i <= n + 3; i++) {
    for (j = 0; j <= m + 3; j++) {
      c[i][j] = '.';
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> c[i][j];
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (c[i][j] == 'S') {
        if (c[i + 1][j] == 'W' || c[i - 1][j] == 'W' || c[i][j - 1] == 'W' ||
            c[i][j + 1] == 'W') {
          cout << "No";
          return 0;
        }
      }
    }
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (c[i][j] == '.') {
        c[i][j] = 'D';
      }
    }
  }
  cout << "Yes" << endl;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cout << c[i][j];
    }
    cout << endl;
  }
  return 0;
}
