#include <bits/stdc++.h>
using namespace std;
const int N = 500 + 10;
int n, m;
vector<string> f(N);
bool protect(int i, int j) {
  if (f[i][j] != 'W') return true;
  if (i > 0 && f[i - 1][j] == 'S')
    return false;
  else if (i > 0 && f[i - 1][j] == '.')
    f[i - 1][j] = 'D';
  if (j > 0 && f[i][j - 1] == 'S')
    return false;
  else if (j > 0 && f[i][j - 1] == '.')
    f[i][j - 1] = 'D';
  if (i < n - 1 && f[i + 1][j] == 'S')
    return false;
  else if (i < n - 1 && f[i + 1][j] == '.')
    f[i + 1][j] = 'D';
  if (j < m - 1 && f[i][j + 1] == 'S')
    return false;
  else if (j < m - 1 && f[i][j + 1] == '.')
    f[i][j + 1] = 'D';
  return true;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> f[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!protect(i, j)) {
        cout << "No\n";
        return 0;
      }
  cout << "Yes\n";
  for (int i = 0; i < n; i++) cout << f[i] << endl;
  return 0;
}
