#include <bits/stdc++.h>
using namespace std;
char arr[502][502];
int main() {
  ios_base::sync_with_stdio(false);
  int o = 0, z = 0;
  cin >> o >> z;
  for (int i = 1; i <= o; i++)
    for (int j = 1; j <= z; j++) {
      cin >> arr[i][j];
    }
  for (int i = 1; i <= o; i++)
    for (int j = 1; j <= z; j++) {
      if (arr[i][j] == 'W') {
        if (arr[i + 1][j] == 'S') {
          cout << "No";
          return 0;
        } else if (arr[i + 1][j] != 'W')
          arr[i + 1][j] = 'D';
        if (arr[i - 1][j] == 'S') {
          cout << "No";
          return 0;
        } else if (arr[i - 1][j] != 'W')
          arr[i - 1][j] = 'D';
        if (arr[i][j + 1] == 'S') {
          cout << "No";
          return 0;
        } else if (arr[i][j + 1] != 'W')
          arr[i][j + 1] = 'D';
        if (arr[i][j - 1] == 'S') {
          cout << "No";
          return 0;
        } else if (arr[i][j - 1] != 'W')
          arr[i][j - 1] = 'D';
      }
    }
  cout << "Yes\n";
  for (int i = 1; i <= o; i++) {
    for (int j = 1; j <= z; j++) cout << arr[i][j];
    cout << endl;
  }
  return 0;
}
