#include <bits/stdc++.h>
using namespace std;
const int MX = 505, MY = 660000;
bitset<MX> A[MX][MX], B[MX][MX];
int N, M, Qu;
char S[MX][MX];
int An[MY];
struct Query {
  int xi, yi, xj, yj, id;
} Q[MY], tmpl[MY], tmpr[MY];
void Divide(int L, int R, int l, int r) {
  if (L > R || l > r) return;
  int m = (l + r) >> 1, lc = 0, rc = 0;
  for (int j = (M); j >= (1); --j) {
    if (S[m][j] == '.')
      A[m][j] = A[m][j + 1], A[m][j][j] = 1;
    else
      A[m][j].reset();
  }
  for (int i = (m - 1); i >= (l); --i)
    for (int j = (M); j >= (1); --j) {
      if (S[i][j] == '.')
        A[i][j] = A[i + 1][j] | A[i][j + 1];
      else
        A[i][j].reset();
    }
  for (int j = (1); j <= (M); ++j) {
    if (S[m][j] == '.')
      B[m][j] = B[m][j - 1], B[m][j][j] = 1;
    else
      B[m][j].reset();
  }
  for (int i = (m + 1); i <= (r); ++i)
    for (int j = (1); j <= (M); ++j) {
      if (S[i][j] == '.')
        B[i][j] = B[i - 1][j] | B[i][j - 1];
      else
        B[i][j].reset();
    }
  for (int i = (L); i <= (R); ++i) {
    int xi = Q[i].xi, yi = Q[i].yi, xj = Q[i].xj, yj = Q[i].yj;
    if (xi < m && xj < m) {
      tmpl[++lc] = Q[i];
      continue;
    }
    if (xi > m && xj > m) {
      tmpr[++rc] = Q[i];
      continue;
    }
    An[Q[i].id] = (A[xi][yi] & B[xj][yj]).any();
  }
  for (int i = (1); i <= (lc); ++i) Q[L + i - 1] = tmpl[i];
  for (int i = (1); i <= (rc); ++i) Q[L + lc + i - 1] = tmpr[i];
  Divide(L, L + lc - 1, l, m - 1);
  Divide(L + lc, L + lc + rc - 1, m + 1, r);
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = (1); i <= (N); ++i) scanf("%s", S[i] + 1);
  scanf("%d", &Qu);
  for (int i = (1); i <= (Qu); ++i)
    scanf("%d%d%d%d", &Q[i].xi, &Q[i].yi, &Q[i].xj, &Q[i].yj), Q[i].id = i;
  Divide(1, Qu, 1, N);
  for (int i = (1); i <= (Qu); ++i) printf(An[i] ? "Yes\n" : "No\n");
  return 0;
}
