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