#include <bits/stdc++.h>
using namespace std;
char t[501][501];
vector<pair<int, int> > m;
bool b;
int main() {
  b = true;
  m.push_back(make_pair(1, 0));
  m.push_back(make_pair(-1, 0));
  m.push_back(make_pair(0, 1));
  m.push_back(make_pair(0, -1));
  int l, c;
  cin >> l >> c;
  for (int i = 0; i <= l + 1; i++) {
    for (int j = 0; j <= c + 1; j++) {
      t[i][j] = '.';
    }
  }
  for (int i = 1; i <= l; i++) {
    for (int j = 1; j <= c; j++) {
      cin >> t[i][j];
    }
  }
  for (int i = 1; i <= l; i++) {
    for (int j = 1; j <= c; j++) {
      for (int k = 0; k < 4; k++) {
        if (t[i][j] == 'S' && t[i + m[k].first][j + m[k].second] == 'W') {
          b = false;
          break;
        } else if (t[i][j] == 'S' &&
                   t[i + m[k].first][j + m[k].second] != 'S') {
          t[i + m[k].first][j + m[k].second] = 'D';
        }
      }
    }
  }
  if (b == false) {
    cout << "No";
  } else {
    cout << "Yes"
         << "\n";
    for (int i = 1; i <= l; i++) {
      for (int j = 1; j <= c; j++) {
        cout << t[i][j];
      }
      cout << "\n";
    }
  }
}
