#include <bits/stdc++.h>   using namespace std;   int n, m;   int dx[] = {0, -1, 0, 1};   int dy[] = {-1, 0, 1, 0};   char a[505][505];   int main() {     cin >> n >> m;     for (int i = 1; i <= n; i++) cin >> a[i] + 1;     bool flag = 1;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= m; j++) {         for (int k = 0; k <= 3; k++) {           if (a[i + dx[k]][j + dy[k]] ==  S  && a[i][j] ==  W ) flag = 0;           if (a[i + dx[k]][j + dy[k]] ==  W  && a[i][j] ==  S ) flag = 0;         }         if (a[i][j] !=  W  && a[i][j] !=  S ) a[i][j] =  D ;       }     if (flag == 0) {       cout <<  No  << endl;     } else {       cout <<  Yes  << endl;       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           cout << a[i][j];         }         cout << endl;       }     }     return 0;   }   