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