#include <bits/stdc++.h>
using namespace std;
namespace forever {
template <class type1, class type2>
inline istream &operator>>(istream &in, pair<type1, type2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <class type1, class type2>
inline ostream &operator<<(ostream &o, pair<type1, type2> &p) {
  o << "(" << p.first << "," << p.second << ")\n";
  return o;
}
template <class type>
inline ostream &operator<<(ostream &o, vector<type> &v) {
  for (long long i = 0; i < v.size(); i++) o << v[i] << " ";
  return o;
}
template <class t>
inline istream &operator>>(istream &in, vector<t> &p) {
  for (auto &x : p) in >> x;
  return in;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
}  // namespace forever
using namespace forever;
const long long mod = 1e9 + 7;
long long power(long long x, long long y, long long p = mod) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = (y >> 1);
    x = (x * x) % p;
  }
  return res;
}
void test_cases() {
  long long i, j, n, m;
  cin >> n >> m;
  long long flag = 0;
  vector<string> s(n);
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (s[i][j] == 'S') {
        flag = 0;
        if ((i >= 1 && s[i - 1][j] == 'W') || (j >= 1 && s[i][j - 1] == 'W') ||
            (i + 1 < n && s[i + 1][j] == 'W') ||
            (j + 1 < m && s[i][j + 1] == 'W')) {
          flag = 1;
          break;
        }
        if (i >= 1 && s[i - 1][j] == '.') s[i - 1][j] = 'D';
        if (j >= 1 && s[i][j - 1] == '.') s[i][j - 1] = 'D';
        if (i + 1 < n && s[i + 1][j] == '.') s[i + 1][j] = 'D';
        if (j + 1 < m && s[i][j + 1] == '.') s[i][j + 1] = 'D';
      }
    }
    if (flag == 1) break;
  }
  if (flag == 1) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
    for (i = 0; i < n; i++) cout << s[i] << "\n";
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    test_cases();
  }
  return 0;
}
