#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
bool compare(int a, int b) { return a > b; }
int Atoi(string s, int radix) {
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    char t = s[i];
    if (t >= '0' && t <= '9')
      ans = ans * radix + t - '0';
    else
      ans = ans * radix + t - 'a' + 10;
  }
  return ans;
}
int direct[10][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
char s[505][505];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int R, C;
  cin >> R >> C;
  for (int i = 1; i <= R; i++) {
    cin >> s[i] + 1;
  }
  int flag = 1;
  for (int i = 1; i <= R; i++) {
    for (int j = 1; j <= C; j++) {
      if (s[i][j] == 'W') {
        for (int k = 0; k < 4; k++) {
          if (s[i + direct[k][0]][j + direct[k][1]] == 'S') {
            flag = 0;
            break;
          }
        }
      }
    }
  }
  if (flag == 0)
    cout << "No\n";
  else {
    cout << "Yes\n";
    for (int i = 1; i <= R; i++) {
      for (int j = 1; j <= C; j++) {
        if (s[i][j] == '.')
          cout << 'D';
        else
          cout << s[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
