#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, flag = 0;
  char arr[510][510] = {0};
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    scanf("%s", arr[i] + 1);
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      if (arr[i][j] == 'S') {
        if (arr[i][j + 1] == 'W' || arr[i][j - 1] == 'W' ||
            arr[i + 1][j] == 'W' || arr[i - 1][j] == 'W') {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 1) {
      break;
    }
  }
  if (!flag) {
    printf("Yes\n");
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) {
        if (arr[i][j] == '.') {
          arr[i][j] = 'D';
        }
        printf("%c", arr[i][j]);
      }
      printf("\n");
    }
  } else {
    printf("No\n");
  }
  return 0;
}
