#include <bits/stdc++.h>
using namespace std;
const vector<int> dx{-1, 1, 0, 0};
const vector<int> dy{0, 0, 1, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<char> > ch(n, vector<char>(m));
  bool mark = false, mark1 = false;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> ch[i][j];
      if (ch[i][j] == '.') ch[i][j] = 'D';
      if (ch[i][j] == 'W') mark = true;
      if (ch[i][j] == 'S') mark1 = true;
    }
  if (!mark || !mark1) {
    cout << "Yes" << '\n';
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) cout << ch[i][j];
      cout << '\n';
    }
    return 0;
  }
  queue<pair<int, int> > g;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (ch[i][j] == 'W') g.push(make_pair(i, j));
  while (!g.empty()) {
    int x = g.front().first;
    int y = g.front().second;
    g.pop();
    for (int i = 0; i < 4; i++) {
      int nx = x + dx[i];
      int ny = y + dy[i];
      if (nx == n || nx == -1 || ny == m || ny == -1) continue;
      if (ch[nx][ny] == 'D') continue;
      if (ch[nx][ny] == 'S') {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes" << '\n';
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << ch[i][j];
    cout << '\n';
  }
  return 0;
}
