#include <bits/stdc++.h>
using namespace std;
void setIO(string name) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  freopen((name + ".in").c_str(), "r", stdin);
  freopen((name + ".out").c_str(), "w", stdout);
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  int r, c;
  cin >> r >> c;
  char a[r][c];
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cin >> a[i][j];
      if (a[i][j] == '.') {
        a[i][j] = 'D';
      }
    }
  }
  int f = 1;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (a[i][j] == 'S') {
        if ((i - 1 >= 0 && a[i - 1][j] == 'W') ||
            (j - 1 >= 0 && a[i][j - 1] == 'W') ||
            (i + 1 <= r - 1 && a[i + 1][j] == 'W') ||
            (j + 1 <= c - 1 && a[i][j + 1] == 'W')) {
          f = 0;
          break;
        }
      }
    }
  }
  if (f) {
    cout << "Yes"
         << "\n";
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        cout << a[i][j];
      }
      cout << "\n";
    }
  } else {
    cout << "No"
         << "\n";
  }
}
