#include <bits/stdc++.h>
using namespace std;
int n, m, q;
char ch;
int mp[505][505];
int ans[600005];
struct node {
  int a, b, c, d, num;
} f[600005], ff[600005];
bitset<505> f1[505][505], f2[505][505], bst;
void solve(int l, int r, int fl, int fr) {
  if (l > r || fl > fr) return;
  int mid = (l + r) / 2;
  int ffl = fl - 1, ffr = fr + 1;
  for (int i = 1; i <= m; i++) {
    f1[mid][i] = f2[mid][i] = 0;
  }
  for (int i = m; i > 0; i--) {
    if (mp[mid][i] == 0) {
      f1[mid][i][i] = 1;
      f1[mid][i] = f1[mid][i] | f1[mid][i + 1];
    }
  }
  for (int i = 1; i <= m; i++) {
    if (mp[mid][i] == 0) {
      f2[mid][i][i] = 1;
      f2[mid][i] = f2[mid][i] | f2[mid][i - 1];
    }
  }
  for (int i = mid - 1; i >= l; i--) {
    for (int j = m; j > 0; j--) {
      if (mp[i][j] == 0) {
        f1[i][j] = f1[i + 1][j] | f1[i][j + 1];
      } else {
        f1[i][j] = 0;
      }
    }
  }
  for (int i = mid + 1; i <= r; i++) {
    for (int j = 1; j <= m; j++) {
      if (mp[i][j] == 0) {
        f2[i][j] = f2[i - 1][j] | f2[i][j - 1];
      } else {
        f2[i][j] = 0;
      }
    }
  }
  for (int i = fl; i <= fr; i++) {
    if (f[i].c < mid) {
      ffl++;
      ff[ffl] = f[i];
    } else if (f[i].a > mid) {
      ffr--;
      ff[ffr] = f[i];
    } else {
      bst = f1[f[i].a][f[i].b] & f2[f[i].c][f[i].d];
      if (bst.count() != 0) {
        ans[f[i].num] = 1;
      } else {
        ans[f[i].num] = 0;
      }
    }
  }
  for (int i = fl; i <= ffl; i++) {
    f[i] = ff[i];
  }
  for (int i = ffr; i <= fr; i++) {
    f[i] = ff[i];
  }
  solve(l, mid - 1, fl, ffl);
  solve(mid + 1, r, ffr, fr);
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> ch;
      if (ch == '.') {
        mp[i][j] = 0;
        continue;
      }
      mp[i][j] = 1;
    }
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d%d%d", &f[i].a, &f[i].b, &f[i].c, &f[i].d);
    f[i].num = i;
  }
  solve(1, n, 1, q);
  for (int i = 1; i <= q; i++) {
    if (ans[i] == 1) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
