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