#include <bits/stdc++.h>
using namespace std;
const int N = 520;
char farm[N][N];
void dfs(int a, int b) {
  if (farm[a + 1][b] == 'W' or farm[a - 1][b] == 'W' or farm[a][b + 1] == 'W' or
      farm[a][b - 1] == 'W') {
    cout << "No";
    exit(0);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) farm[i][j + 1] = s[j];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (farm[i][j] == 'S') dfs(i, j);
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (farm[i][j] == '.')
        cout << "D";
      else
        cout << farm[i][j];
    }
    cout << endl;
  }
}
