#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = (((1 << 30) - 1) << 1) + 1;
const int nINF = 1 << 31;
vector<vector<int>> g;
int r, c;
bool good(int i, int j) {
  if (i + 1 < r) {
    if (g[i + 1][j] == 2)
      return false;
    else if (g[i + 1][j] == 0)
      g[i + 1][j] = 3;
  }
  if (i > 0) {
    if (g[i - 1][j] == 2)
      return false;
    else if (g[i - 1][j] == 0)
      g[i - 1][j] = 3;
  }
  if (j + 1 < c) {
    if (g[i][j + 1] == 2)
      return false;
    else if (g[i][j + 1] == 0)
      g[i][j + 1] = 3;
  }
  if (j > 0) {
    if (g[i][j - 1] == 2)
      return false;
    else if (g[i][j - 1] == 0)
      g[i][j - 1] = 3;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> r >> c;
  g.resize(r, vector<int>(c, 0));
  for (int i = 0; i < (r); i++) {
    for (int j = 0; j < (c); j++) {
      char ch;
      cin >> ch;
      if (ch == 'W')
        g[i][j] = 2;
      else if (ch == 'S')
        g[i][j] = 1;
    }
  }
  for (int i = 0; i < (r); i++) {
    for (int j = 0; j < (c); j++) {
      if (g[i][j] == 1) {
        if (!good(i, j)) {
          cout << "No" << endl;
          exit(0);
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 0; i < (r); i++) {
    for (int j = 0; j < (c); j++) {
      if (g[i][j] == 0)
        cout << '.';
      else if (g[i][j] == 1)
        cout << 'S';
      else if (g[i][j] == 2)
        cout << 'W';
      else if (g[i][j] == 3)
        cout << 'D';
    }
    cout << endl;
  }
  return 0;
}
