#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
using namespace std;
vector<long long> v1;
bool flag = false;
int solve() {
  int r, c;
  cin >> r >> c;
  bool flag = false;
  char s[r + 2][c + 2], ch;
  for (int i = 0; i < r + 1; i++) {
    s[i][0] = 'D';
    s[i][c + 1] = 'D';
  }
  for (int i = 0; i < c + 1; i++) {
    s[0][i] = 'D';
    s[r + 1][i] = 'D';
  }
  for (int i = 1; i < r + 1; i++) {
    for (int j = 1; j < c + 1; j++) {
      cin >> ch;
      if (ch == '.')
        s[i][j] = 'D';
      else
        s[i][j] = ch;
    }
  }
  for (int i = 1; i < r + 1; i++)
    for (int j = 1; j < c + 1; j++) {
      if (s[i][j] == 'S') {
        if (s[i - 1][j] == 'W' || s[i][j + 1] == 'W' || s[i][j - 1] == 'W' ||
            s[i + 1][j] == 'W')
          flag = true;
      }
    }
  if (flag)
    cout << "No";
  else {
    cout << "Yes" << '\n';
    for (int i = 1; i < r + 1; i++) {
      for (int j = 1; j < c + 1; j++) {
        cout << s[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
