#include <bits/stdc++.h>
using namespace std;
int n, m;
int arr[502][502] = {{0}};
int main() {
  cin >> n >> m;
  string input[n + 1];
  for (int i = 1; i <= n; i++) cin >> input[i];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (input[i][j - 1] == 'S')
        arr[i][j] = 1;
      else if (input[i][j - 1] == 'W')
        arr[i][j] = 2;
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (arr[i][j] == 1) {
        if (arr[i][j + 1] == 2 or arr[i][j - 1] == 2 or arr[i + 1][j] == 2 or
            arr[i - 1][j] == 2) {
          cout << "No\n";
          return 0;
        }
        if (arr[i][j + 1] == 0) arr[i][j + 1] = 3;
        if (arr[i][j - 1] == 0) arr[i][j - 1] = 3;
        if (arr[i + 1][j] == 0) arr[i + 1][j] = 3;
        if (arr[i - 1][j] == 0) arr[i - 1][j] = 3;
      }
    }
  cout << "Yes\n";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (arr[i][j] == 0)
        cout << '.';
      else if (arr[i][j] == 1)
        cout << 'S';
      else if (arr[i][j] == 2)
        cout << 'W';
      else if (arr[i][j] == 3)
        cout << 'D';
    }
    cout << endl;
  }
  return 0;
}
