#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int main() {
  ios_base::sync_with_stdio(false);
  int r, s, a = 1;
  cin >> r >> s;
  v.resize(r + 2);
  for (int i = 1; i <= r; i++) {
    cin >> v[i];
    for (int j = 0; j < s; j++)
      if (v[i][j] == '.') v[i][j] = 'D';
  }
  for (int i = 2; i <= r; i++) {
    for (int j = 0; j < s; j++) {
      if (v[i][j] == 'S' && v[i - 1][j] == 'W') {
        a = 0;
        break;
      }
    }
  }
  for (int i = 1; i < r; i++) {
    for (int j = 0; j < s; j++) {
      if (v[i][j] == 'S' && v[i + 1][j] == 'W') {
        a = 0;
        break;
      }
    }
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j < s; j++) {
      if (v[i][j] == 'S' && v[i][j - 1] == 'W') {
        a = 0;
        break;
      }
    }
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 0; j < s - 1; j++) {
      if (v[i][j] == 'S' && v[i][j + 1] == 'W') {
        a = 0;
        break;
      }
    }
  }
  if (a == 0)
    cout << "No";
  else {
    cout << "Yes\n";
    for (int i = 1; i <= r; i++) cout << v[i] << "\n";
  }
  return 0;
}
