#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int arr[10000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m, T, res;
  int maxi = -(1 << 30) - 1, mini = (1 << 30) - 1, count = 0;
  int i, j, k;
  bool flag;
  string s1, s2;
  char s[505][505];
  int ara[100005], ara2[100005];
  cin >> n >> m;
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    for (int j = (int)(0); j <= (int)(m - 1); j++) {
      cin >> s[i][j];
    }
  }
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    for (int j = (int)(0); j <= (int)(m - 1); j++) {
      if (s[i][j] == 'S') {
        if ((s[i][j + 1] == 'W' && j < m - 1) ||
            (s[i][j - 1] == 'W' && j > 0) || (s[i - 1][j] == 'W' && i > 0) ||
            (s[i + 1][j] == 'W' && i < n - 1)) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    for (int j = (int)(0); j <= (int)(m - 1); j++) {
      if (s[i][j] == '.') s[i][j] = 'D';
    }
  }
  cout << "Yes" << endl;
  for (int i = (int)(0); i <= (int)(n - 1); i++) {
    for (int j = (int)(0); j <= (int)(m - 1); j++) {
      cout << s[i][j];
    }
    cout << endl;
  }
}
