#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c;
  cin >> r >> c;
  char a[r + 1][c + 1];
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (a[i][j] == '.') {
        a[i][j] = 'D';
      }
    }
  }
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      if (a[i][j] == 'W') {
        if ((a[i - 1][j] == 'S' && (i - 1) != -1) ||
            (a[i + 1][j] == 'S' && (i + 1) != r) ||
            (a[i][j - 1] == 'S' && (j - 1) != -1) ||
            (a[i][j + 1] == 'S' && (j + 1) != c)) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      cout << a[i][j];
    }
    cout << endl;
  }
  return 0;
}
