#include <bits/stdc++.h>
using namespace std;
const int mxn = 610;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 - '0' + ch;
    ch = getchar();
  }
  return x * f;
}
int n, m, Q, sv = 0;
struct query {
  int x1, y1, x2, y2;
  int id;
} q[mxn * 1000];
char mp[mxn][mxn];
vector<int> qu;
bool vis[mxn * 1000];
bool ans[mxn * 1000];
bitset<mxn> L[mxn][mxn], R[mxn][mxn];
void solve(int l, int r, vector<int> qv) {
  if (l > r) return;
  int i, j;
  int mid = (l + r) >> 1;
  for (i = mid; i >= l; i--) {
    for (j = m; j; j--) {
      L[i][j] = 0;
      if (mp[i][j] == '.') {
        if (i == mid)
          L[i][j][j] = 1;
        else
          L[i][j] |= L[i + 1][j];
        if (j < m) L[i][j] |= L[i][j + 1];
      }
    }
  }
  for (i = mid; i <= r; i++) {
    for (j = 1; j <= m; j++) {
      R[i][j] = 0;
      if (mp[i][j] == '.') {
        if (i == mid)
          R[i][j][j] = 1;
        else
          R[i][j] |= R[i - 1][j];
        if (j > 1) R[i][j] |= R[i][j - 1];
      }
    }
  }
  vector<int> ql, qr;
  for (i = 0; i < qv.size(); i++) {
    int v = qv[i];
    if (q[v].x2 < mid)
      ql.push_back(v);
    else if (q[v].x1 > mid)
      qr.push_back(v);
    else
      ans[q[v].id] = (L[q[v].x1][q[v].y1] & R[q[v].x2][q[v].y2]).any();
  }
  solve(l, mid - 1, ql);
  solve(mid + 1, r, qr);
  return;
}
int main() {
  int i, j;
  n = read();
  m = read();
  for (i = 1; i <= n; i++) scanf("%s", mp[i] + 1);
  Q = read();
  for (i = 1; i <= Q; i++) {
    q[i].x1 = read();
    q[i].y1 = read();
    q[i].x2 = read();
    q[i].y2 = read();
    q[i].id = i;
    qu.push_back(i);
  }
  solve(1, n, qu);
  for (i = 1; i <= Q; i++) {
    printf("%s\n", ans[i] ? "Yes" : "No");
  }
  return 0;
}
