#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 20;
int r, c;
char m[maxn][maxn];
int main() {
  cin >> r >> c;
  for (int i = 1; i < r + 1; i++) {
    for (int j = 1; j < c + 1; j++) {
      cin >> m[i][j];
    }
  }
  for (int i = 1; i < r + 1; i++) {
    for (int j = 1; j < c + 1; j++) {
      if (m[i][j] == 'S') {
        if (m[i + 1][j] == 'W') {
          cout << "No";
          return 0;
        }
        if (m[i - 1][j] == 'W') {
          cout << "No";
          return 0;
        }
        if (m[i][j + 1] == 'W') {
          cout << "No";
          return 0;
        }
        if (m[i][j - 1] == 'W') {
          cout << "No";
          return 0;
        }
      }
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i < r + 1; i++) {
    for (int j = 1; j < c + 1; j++) {
      if (m[i][j] == '.') {
        cout << "D";
      } else {
        cout << m[i][j];
      }
    }
    cout << endl;
  }
  return 0;
}
