#include <bits/stdc++.h>
using namespace std;
int main() {
  int R, C;
  cin >> R >> C;
  char m[R][C];
  for (int i = 0; i < R; i++)
    for (int j = 0; j < C; j++) cin >> m[i][j];
  for (int i = 0; i < R; i++)
    for (int j = 0; j < C; j++) {
      if (m[i][j] == 'S') {
        if (i > 0)
          if (m[i - 1][j] == 'W') {
            cout << "No\n";
            return 0;
          }
        if (i < R - 1)
          if (m[i + 1][j] == 'W') {
            cout << "No\n";
            return 0;
          }
        if (j > 0)
          if (m[i][j - 1] == 'W') {
            cout << "No\n";
            return 0;
          }
        if (j < C - 1)
          if (m[i][j + 1] == 'W') {
            cout << "No\n";
            return 0;
          }
      }
    }
  cout << "Yes\n";
  for (int i = 0; i < R; i++)
    for (int j = 0; j < C; j++)
      if (m[i][j] == '.') m[i][j] = 'D';
  for (int i = 0; i < R; i++) {
    for (int j = 0; j < C; j++) {
      cout << m[i][j];
    }
    cout << "\n";
  }
  return 0;
}
