#include <bits/stdc++.h>
using namespace std;
char mp[600][600];
int xc[] = {1, 0, -1, 0};
int yc[] = {0, 1, 0, -1};
int main(int argc, char const *argv[]) {
  int m, n;
  while (scanf("%d%d", &m, &n) != EOF) {
    int flag = 1;
    for (int i = 0; i < m; ++i) {
      scanf("%s", mp[i]);
    }
    int xx, yy;
    for (int i = 0; i < m; ++i) {
      for (int j = 0; j < n; ++j) {
        if (mp[i][j] == 'W') {
          for (int k = 0; k < 4; ++k) {
            xx = i + xc[k];
            yy = j + yc[k];
            if (xx >= 0 && yy >= 0 && xx < m && yy < n && mp[xx][yy] == 'S') {
              flag = 0;
              break;
            }
          }
          if (flag == 0) break;
        }
      }
      if (flag == 0) break;
    }
    if (flag) {
      printf("Yes\n");
      for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
          if (mp[i][j] == '.')
            printf("D");
          else
            printf("%c", mp[i][j]);
        }
        printf("\n");
      }
    } else
      printf("No\n");
  }
  return 0;
}
