#include <bits/stdc++.h>
using namespace std;
int R, C;
char gr[505][505];
int hR[505][505], lX[505][505], rX[505][505];
int Q;
int qX1[600005], qY1[600005], qX2[600005], qY2[600005];
bool ans[600005];
vector<int> rowQ[505];
int main() {
  scanf("%d %d", &R, &C);
  for (int(i) = (1); (i) < (R + 1); ++(i))
    for (int(p) = (1); (p) < (C + 1); ++(p)) scanf(" %c ", &gr[i][p]);
  for (int(i) = (1); (i) < (C + 1); ++(i)) gr[0][i] = gr[R + 1][i] = '#';
  for (int(i) = (1); (i) < (R + 1); ++(i)) gr[i][0] = gr[i][C + 1] = '#';
  for (int(i) = (1); (i) < (R + 1); ++(i)) {
    for (int(p) = (0); (p) < (C + 1); ++(p)) {
      if (gr[i][p] == '#')
        hR[i][p] = 505 + 5;
      else {
        hR[i][p] = i;
        hR[i][p] = min(min(hR[i - 1][p], hR[i][p - 1]), hR[i][p]);
      }
    }
  }
  scanf("%d", &Q);
  for (int(i) = (0); (i) < (Q); ++(i)) {
    scanf("%d %d %d %d", &qY1[i], &qX1[i], &qY2[i], &qX2[i]);
    rowQ[qY2[i]].push_back(i);
  }
  for (int(i) = (1); (i) < (R + 1); ++(i)) {
    for (int p = C + 1; p > 0; p--) {
      if (gr[i][p] == '#') {
        rX[i][p] = 0;
        lX[i][p] = 505 + 5;
      } else {
        lX[i][p] = p;
        rX[i][p] = max(p, rX[i][p + 1]);
      }
    }
    for (int p = i - 1; p > 0; p--) {
      for (int t = C + 1; t > 0; t--) {
        if (gr[p][t] == '#') {
          rX[p][t] = 0;
          lX[p][t] = 505 + 5;
        } else {
          rX[p][t] = max(rX[p][t + 1], rX[p + 1][t]);
          lX[p][t] = min(lX[p][t + 1], lX[p + 1][t]);
        }
      }
    }
    for (int(p) = (0); (p) < (rowQ[i].size()); ++(p)) {
      int x1 = qX1[rowQ[i][p]];
      int y1 = qY1[rowQ[i][p]];
      int x2 = qX2[rowQ[i][p]];
      int y2 = qY2[rowQ[i][p]];
      if (lX[y1][x1] <= x2 && rX[y1][x1] >= x2 && hR[y2][x2] <= y1)
        ans[rowQ[i][p]] = true;
    }
  }
  for (int(i) = (0); (i) < (Q); ++(i)) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
