#include <bits/stdc++.h>
using namespace std;
char ch[505][505];
int main() {
  int r, c;
  scanf("%d%d", &r, &c);
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      ch[i][j] = getchar();
      while (ch[i][j] != '.' && ch[i][j] != 'S' && ch[i][j] != 'W') {
        ch[i][j] = getchar();
      }
    }
  }
  for (int i = 1; i <= r; i++) {
    ch[i][0] = '.';
    ch[i][c + 1] = '.';
  }
  for (int i = 1; i <= c; i++) {
    ch[0][i] = '.';
    ch[r + 1][i] = '.';
  }
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (ch[i][j] == 'S') {
        if (ch[i + 1][j] == 'W') {
          cout << "No";
          return 0;
        }
        if (ch[i - 1][j] == 'W') {
          cout << "No";
          return 0;
        }
        if (ch[i][j + 1] == 'W') {
          cout << "No";
          return 0;
        }
        if (ch[i][j - 1] == 'W') {
          cout << "No";
          return 0;
        }
      }
      if (ch[i][j] == 'W') {
        if (ch[i + 1][j] == 'S') {
          cout << "No";
          return 0;
        }
        if (ch[i - 1][j] == 'S') {
          cout << "No";
          return 0;
        }
        if (ch[i][j + 1] == 'S') {
          cout << "No";
          return 0;
        }
        if (ch[i][j - 1] == 'S') {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i <= r; i++) {
    for (int j = 1; j <= c; j++) {
      if (ch[i][j] == '.')
        cout << 'D';
      else
        cout << ch[i][j];
    }
    cout << endl;
  }
  return 0;
}
