func_code_string: #include <bits/stdc++.h>   using namespace std;   char s[505][505];   int main() {     int n, m;     cin >> n >> m;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         scanf(  %c , &s[i][j]);       }     }     bool ok = 1;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (s[i][j] ==  W ) {           if (s[i + 1][j] ==  . )             s[i + 1][j] =  D ;           else if (s[i + 1][j] ==  S )             ok = 0;           if (s[i - 1][j] ==  . )             s[i - 1][j] =  D ;           else if (s[i - 1][j] ==  S )             ok = 0;           if (s[i][j + 1] ==  . )             s[i][j + 1] =  D ;           else if (s[i][j + 1] ==  S )             ok = 0;           if (s[i][j - 1] ==  . )             s[i][j - 1] =  D ;           else if (s[i][j - 1] ==  S )             ok = 0;           if (!ok) {             cout <<  No  << endl;             return 0;           }         }       }     }     cout <<  Yes  << endl;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         printf( %c , s[i][j]);       }       printf(  n );     }   }   