func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, q, ans[600005];   bitset<505> a[505][505], b[505][505];   char mp[505][505];   struct ccf {     int x1, y1, x2, y2, id;   };   void solve(int l, int r, vector<ccf> qus) {     if (!qus.size()) return;     int mid = (l + r) >> 1;     for (int i = mid; i >= l; i--) {       for (int j = m; j >= 1; j--) {         a[i][j].reset();         if (i == mid) a[mid][j][j] = (mp[mid][j] ==  . );         if (i != mid && mp[i + 1][j] ==  . ) a[i][j] |= a[i + 1][j];         if (j != m && mp[i][j + 1] ==  . ) a[i][j] |= a[i][j + 1];       }     }     for (int i = mid; i <= r; i++) {       for (int j = 1; j <= m; j++) {         b[i][j].reset();         if (i == mid) b[mid][j][j] = (mp[mid][j] ==  . );         if (i != mid && mp[i - 1][j] ==  . ) b[i][j] |= b[i - 1][j];         if (j != 1 && mp[i][j - 1] ==  . ) b[i][j] |= b[i][j - 1];       }     }     vector<ccf> askl, askr;     int len = qus.size();     for (int i = 0; i < len; i++) {       if (qus[i].x2 < mid)         askl.push_back(qus[i]);       else if (qus[i].x1 > mid)         askr.push_back(qus[i]);       else         ans[qus[i].id] =             (a[qus[i].x1][qus[i].y1] & b[qus[i].x2][qus[i].y2]).any();     }     solve(l, mid - 1, askl);     solve(mid + 1, r, askr);   }   vector<ccf> eve;   int main() {     scanf( %d%d , &n, &m);     for (int i = 1; i <= n; i++) cin >> (mp[i] + 1);     scanf( %d , &q);     for (int i = 1; i <= q; i++) {       ccf qus;       qus.id = i;       scanf( %d%d%d%d , &qus.x1, &qus.y1, &qus.x2, &qus.y2);       eve.push_back(qus);     }     solve(1, n, eve);     for (int i = 1; i <= q; i++)       if (ans[i])         puts( Yes );       else         puts( No );     return 0;   }   