#include <bits/stdc++.h>
using namespace std;
char c[505][505];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    long long row, col;
    cin >> row >> col;
    for (long long i = 1; i <= row; i++) {
      for (long long j = 1; j <= col; j++) {
        cin >> c[i][j];
      }
    }
    long long flag = 0;
    for (long long i = 1; i <= row; i++) {
      for (long long j = 1; j <= col; j++) {
        if ((c[i][j] == 'S' and c[i - 1][j] == 'W') or
            (c[i][j] == 'S' and c[i + 1][j] == 'W') or
            (c[i][j] == 'S' and c[i][j - 1] == 'W') or
            (c[i][j] == 'S' and c[i][j + 1] == 'W')) {
          flag = 1;
          break;
        }
      }
    }
    if (!flag) {
      cout << "Yes" << endl;
      for (long long i = 1; i <= row; i++) {
        for (long long j = 1; j <= col; j++) {
          if (c[i][j] == 'S') {
            if (c[i - 1][j] == '.') c[i - 1][j] = 'D';
            if (c[i + 1][j] == '.') c[i + 1][j] = 'D';
            if (c[i][j - 1] == '.') c[i][j - 1] = 'D';
            if (c[i][j + 1] == '.') c[i][j + 1] = 'D';
          }
        }
      }
      for (long long i = 1; i <= row; i++) {
        for (long long j = 1; j <= col; j++) {
          cout << c[i][j];
        }
        cout << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
