#include <bits/stdc++.h>
int r, c;
char map[1000][1000];
int main() {
  scanf("%d %d", &r, &c);
  for (int i = 0; i < r; ++i) {
    scanf(" %s", map[i]);
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      if ((map[i][j] == 'S' &&
           (map[i + 1][j] == 'W' or map[i][j + 1] == 'W')) or
          (map[i][j] == 'W' &&
           (map[i + 1][j] == 'S' or map[i][j + 1] == 'S'))) {
        printf("No\n");
        return 0;
      }
    }
  }
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c; ++j) {
      if (map[i][j] == '.') map[i][j] = 'D';
    }
  }
  printf("Yes\n");
  for (int i = 0; i < r; ++i) {
    printf("%s\n", map[i]);
  }
  return 0;
}
