#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  char arr[501][501];
  int r, c, i, j;
  cin >> r >> c;
  for (i = 1; i <= r; i++)
    for (j = 1; j <= c; j++) cin >> arr[i][j];
  for (i = 1; i <= r; i++) {
    for (j = 1; j <= c; j++) {
      if (arr[i][j] == 'S') {
        if (i + 1 <= r && arr[i + 1][j] == 'W') {
          cout << "NO";
          return 0;
        } else if (j + 1 <= c && arr[i][j + 1] == 'W') {
          cout << "NO";
          return 0;
        } else if (j - 1 >= 1 && arr[i][j - 1] == 'W') {
          cout << "NO";
          return 0;
        } else if (i - 1 >= 1 && arr[i - 1][j] == 'W') {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  for (i = 1; i <= r; i++) {
    for (j = 1; j <= c; j++) {
      if (arr[i][j] == '.') {
        arr[i][j] = 'D';
      }
    }
  }
  cout << "Yes" << '\n';
  for (i = 1; i <= r; i++) {
    for (j = 1; j <= c; j++) {
      cout << arr[i][j];
    }
    cout << '\n';
  }
  return 0;
}
