#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1E-7;
const int inf = int(1e9) + 7;
const int MAXN = 500 + 5;
struct node {
  int x1, y1, x2, y2, id;
};
bitset<600005> ans;
bitset<MAXN> dp1[MAXN][MAXN], dp2[MAXN][MAXN];
vector<node> q;
char mp[MAXN][MAXN];
int n, m;
void hzz(int left, int right, vector<node> q) {
  if (left > right || q.size() == 0) return;
  int mid = (left + right) / 2;
  for (int i = n - 1; i >= 0; i--)
    for (int j = mid; j >= left; j--) {
      dp1[i][j].reset();
      if (mp[i][j] != '.') continue;
      if (j == mid) dp1[i][j][i] = true;
      if (j < mid) dp1[i][j] |= dp1[i][j + 1];
      if (i < n - 1) dp1[i][j] |= dp1[i + 1][j];
    }
  for (int i = 0; i <= n - 1; i++)
    for (int j = mid; j <= right; j++) {
      dp2[i][j].reset();
      if (mp[i][j] != '.') continue;
      if (j == mid) dp2[i][j][i] = true;
      if (j > mid) dp2[i][j] |= dp2[i][j - 1];
      if (i > 0) dp2[i][j] |= dp2[i - 1][j];
    }
  vector<node> q1, q2;
  for (int(i) = 0; (i) < (q.size()); ++(i)) {
    if (q[i].y1 <= mid && q[i].y2 >= mid) {
      ans[q[i].id] = (dp1[q[i].x1][q[i].y1] & dp2[q[i].x2][q[i].y2]).any();
    }
    if (q[i].y2 < mid) q1.push_back(q[i]);
    if (q[i].y1 > mid) q2.push_back(q[i]);
  }
  hzz(left, mid - 1, q1);
  hzz(mid + 1, right, q2);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < (n); ++(i)) scanf("%s", mp + i);
  int k;
  scanf("%d", &k);
  for (int(i) = 0; (i) < (k); ++(i)) {
    node tmp;
    scanf("%d%d%d%d", &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
    tmp.x1--;
    tmp.y1--;
    tmp.x2--;
    tmp.y2--;
    tmp.id = i;
    q.push_back(tmp);
  }
  hzz(0, m - 1, q);
  for (int(i) = 0; (i) < (k); ++(i))
    if (ans[i] == true)
      printf("Yes\n");
    else
      printf("No\n");
}
