#include <bits/stdc++.h>
using namespace std;
const int INF = 1 * 1e9;
bool check(vector<vector<int>> &a, int i, int j, int n, int m) {
  if (i - 1 >= 1 && a[i - 1][j] == 2) {
    return 0;
  }
  if (j - 1 >= 1 && a[i][j - 1] == 2) {
    return 0;
  }
  if (i + 1 <= n && a[i + 1][j] == 2) {
    return 0;
  }
  if (j + 1 <= m && a[i][j + 1] == 2) {
    return 0;
  }
  return 1;
}
int main() {
  cout.tie(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> a(n + 1, vector<int>(m + 1));
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      char c;
      cin >> c;
      if (c == '.') {
        a[i][j] = 0;
      }
      if (c == 'S') {
        a[i][j] = 1;
      }
      if (c == 'W') {
        a[i][j] = 2;
      }
    }
  }
  bool ans = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == 1) {
        if (!check(a, i, j, n, m)) {
          ans = 0;
          break;
        }
      }
    }
    if (!ans) {
      break;
    }
  }
  if (!ans) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (!a[i][j]) {
        cout << 'D';
      } else if (a[i][j] == 1) {
        cout << 'S';
      } else {
        cout << 'W';
      }
    }
    cout << '\n';
  }
  return 0;
}
