#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int m, n;
  cin >> m >> n;
  vector<string> kek(m);
  for (string &x : kek) cin >> x;
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < n; ++j)
      if (kek[i][j] == 'S') {
        if (i > 0 && kek[i - 1][j] == 'W') return cout << "No\n", 0;
        if (j > 0 && kek[i][j - 1] == 'W') return cout << "No\n", 0;
        if (i + 1 < m && kek[i + 1][j] == 'W') return cout << "No\n", 0;
        if (j + 1 < n && kek[i][j + 1] == 'W') return cout << "No\n", 0;
      } else if (kek[i][j] == '.')
        kek[i][j] = 'D';
  cout << "Yes\n";
  for (const string &x : kek) cout << x << '\n';
  return 0;
}
