func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5, M = 1e9 + 7;   const unsigned long long base = 13331;   const double Pi = acos(-1.0);   const long long C = 299792458;   inline int read() {     int x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   char a[505][505];   int n, m;   bool check() {     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         if (a[i][j] ==  * ) {           if (i - 1 < 1 || i + 1 > n || j - 1 < 1 || j + 1 > m) continue;           if (a[i - 1][j] ==  *  && a[i + 1][j] ==  *  && a[i][j - 1] ==  *  &&               a[i][j + 1] ==  * ) {             a[i][j] =  . ;             for (int k = i - 1; k >= 1; k--) {               if (a[k][j] ==  * )                 a[k][j] =  . ;               else                 break;             }             for (int k = i + 1; k <= n; k++) {               if (a[k][j] ==  * )                 a[k][j] =  . ;               else                 break;             }             for (int k = j - 1; k >= 1; k--) {               if (a[i][k] ==  * )                 a[i][k] =  . ;               else                 break;             }             for (int k = j + 1; k <= m; k++) {               if (a[i][k] ==  * )                 a[i][k] =  . ;               else                 break;             }             return true;           }         }       }     }     return false;   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> m;     for (int i = 1; i <= n; i++) {       for (int j = 1; j <= m; j++) {         cin >> a[i][j];       }     }     if (!check()) {       cout <<  NO  << endl;     } else {       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           if (a[i][j] ==  * ) {             cout <<  NO  << endl;             return 0;           }         }       }       cout <<  YES  << endl;     }   }   