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