#include <bits/stdc++.h>
using namespace std;
void sieve(long long n, vector<bool> &prime) {
  prime[0] = false;
  prime[1] = false;
  for (long long i = 2; i * i <= n; i++) {
    if (prime[i] == true) {
      for (long long j = i * i; j <= n; j += i) prime[j] = false;
    }
  }
}
int32_t main() {
  long long r, c;
  cin >> r >> c;
  vector<string> v(r);
  for (long long i = (long long)0; i <= (long long)r - 1; i++) {
    cin >> v[i];
  }
  for (long long i = (long long)0; i <= (long long)r - 1; i++) {
    for (long long j = (long long)0; j <= (long long)c - 1; j++) {
      if (v[i][j] == 'S') {
        if (i - 1 >= 0 && i - 1 < r && j >= 0 && j < c && v[i - 1][j] == '.')
          v[i - 1][j] = 'D';
        if (i + 1 >= 0 && i + 1 < r && j >= 0 && j < c && v[i + 1][j] == '.')
          v[i + 1][j] = 'D';
        if (i >= 0 && i < r && j - 1 >= 0 && j - 1 < c && v[i][j - 1] == '.')
          v[i][j - 1] = 'D';
        if (i >= 0 && i < r && j + 1 >= 0 && j + 1 < c && v[i][j + 1] == '.')
          v[i][j + 1] = 'D';
      }
    }
  }
  for (long long i = (long long)0; i <= (long long)r - 1; i++) {
    for (long long j = (long long)0; j <= (long long)c - 1; j++) {
      if (v[i][j] == 'S') {
        if (i - 1 >= 0 && i - 1 < r && j >= 0 && j < c && v[i - 1][j] == 'W') {
          cout << "NO";
          return 0;
        }
        if (i + 1 >= 0 && i + 1 < r && j >= 0 && j < c && v[i + 1][j] == 'W') {
          cout << "NO";
          return 0;
        }
        if (i >= 0 && i < r && j - 1 >= 0 && j - 1 < c && v[i][j - 1] == 'W') {
          cout << "NO";
          return 0;
        }
        if (i >= 0 && i < r && j + 1 >= 0 && j + 1 < c && v[i][j + 1] == 'W') {
          cout << "NO";
          return 0;
        }
      }
    }
  }
  cout << "Yes\n";
  for (long long i = (long long)0; i <= (long long)r - 1; i++)
    cout << v[i] << endl;
}
