#include <bits/stdc++.h>
using namespace std;
namespace ZBXW {
const int N = 505;
char grid[N][N];
void __main__() {
  int r, c;
  cin >> r >> c;
  memset(grid, '.', sizeof(grid));
  for (int i = 1; i <= r; ++i) scanf("%s", grid[i] + 1);
  bool flag = true;
  for (int i = 1; i <= r; ++i) {
    for (int j = 1; j <= c; ++j) {
      if (grid[i][j] == 'W')
        if (grid[i - 1][j] == 'S' || grid[i + 1][j] == 'S' ||
            grid[i][j - 1] == 'S' || grid[i][j + 1] == 'S') {
          flag = false;
          break;
        }
    }
  }
  if (flag) {
    printf("Yes\n");
    for (int i = 1; i <= r; ++i) {
      for (int j = 1; j <= c; ++j) {
        if (grid[i][j] == '.') grid[i][j] = 'D';
      }
    }
    for (int i = 1; i <= r; ++i) printf("%s\n", grid[i] + 1);
  } else {
    printf("No\n");
  }
}
}  // namespace ZBXW
int main() {
  ZBXW::__main__();
  return 0;
}
