func_code_string: #include <bits/stdc++.h>   constexpr double EPS = 1e-9;   using namespace std;   int sz = 0;   int n, m;   vector<vector<pair<int, int>>> ss;   bool vis[51][51];   string grid[51];   void dfs(int r, int c) {     vis[r][c] = 1;     ss[sz].push_back({r, c});     for (int i = 0; i < n; i++) {       if (grid[i][c] ==  #  && !vis[i][c]) dfs(i, c);     }     for (int i = 0; i < m; i++) {       if (grid[r][i] ==  #  && !vis[r][i]) dfs(r, i);     }   }   int main() {     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> grid[i];     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (grid[i][j] ==  #  && !vis[i][j]) {           ss.push_back(vector<pair<int, int>>());           dfs(i, j);           sz++;         }       }     }     for (auto el : ss) {       int rr[51] = {0};       int cc[51] = {0};       for (auto qq : el) {         rr[qq.first] = 1;         cc[qq.second] = 1;       }       int a, b;       a = b = 0;       for (int i = 0; i < 50; i++) {         a += rr[i];         b += cc[i];       }       if (a * b != el.size()) {         cout <<  No ;         return 0;       }     }     cout <<  Yes ;   }   