#include <bits/stdc++.h>
inline int scan() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void Out(int a) {
  if (a < 0) {
    putchar('-');
    a = -a;
  }
  if (a >= 10) Out(a / 10);
  putchar(a % 10 + '0');
}
using namespace std;
char maps[1005][1005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> maps[i][j];
    }
  }
  bool flag = true;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      if (maps[i][j] == 'S') {
        if (maps[i + 1][j] == 'W') flag = false;
        if (maps[i - 1][j] == 'W') flag = false;
        if (maps[i][j + 1] == 'W') flag = false;
        if (maps[i][j - 1] == 'W') flag = false;
      }
  }
  if (flag) {
    cout << "Yes" << endl;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++)
        if (maps[i][j] == '.')
          cout << 'D';
        else
          cout << maps[i][j];
      cout << endl;
    }
  } else
    cout << "No" << endl;
  return 0;
}
