#include <bits/stdc++.h>
using namespace std;
int n, m, q, ans[1000005];
char s[505][505];
bitset<505> f1[505][505], f2[505][505];
struct query {
  int a, b, c, d, id;
} Q[1000005], S[1000005];
int read() {
  char c = getchar();
  int ans = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9')
    ans = (ans << 1) + (ans << 3) + (c ^ 48), c = getchar();
  return ans;
}
void solve(int L, int R, int l, int r) {
  if (L > R || l > r) return;
  int mid = (L + R) >> 1, Sl = l - 1, Sr = r + 1;
  for (int j = m; j >= 1; j--) {
    f1[mid][j] = 0;
    if (s[mid][j] == '.') {
      f1[mid][j][j] = 1;
      if (j < m) f1[mid][j] |= f1[mid][j + 1];
    }
  }
  for (int j = 1; j <= m; j++) {
    f2[mid][j] = 0;
    if (s[mid][j] == '.') {
      f2[mid][j][j] = 1;
      if (j > 1) f2[mid][j] |= f2[mid][j - 1];
    }
  }
  for (int i = mid - 1; i >= L; i--)
    for (int j = m; j >= 1; j--) {
      if (s[i][j] == '#') {
        f1[i][j] = 0;
        continue;
      }
      f1[i][j] = f1[i + 1][j];
      if (j < m) f1[i][j] |= f1[i][j + 1];
    }
  for (int i = mid + 1; i <= R; i++)
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == '#') {
        f2[i][j] = 0;
        continue;
      }
      f2[i][j] = f2[i - 1][j];
      if (j > 1) f2[i][j] |= f2[i][j - 1];
    }
  for (int i = l; i <= r; i++) {
    if (Q[i].c < mid) {
      S[++Sl] = Q[i];
      continue;
    }
    if (Q[i].a > mid) {
      S[--Sr] = Q[i];
      continue;
    }
    ans[Q[i].id] = (f1[Q[i].a][Q[i].b] & f2[Q[i].c][Q[i].d]).any() ? 1 : 0;
  }
  for (int i = l; i <= Sl; i++) Q[i] = S[i];
  for (int i = Sr; i <= r; i++) Q[i] = S[i];
  solve(L, mid - 1, l, Sl);
  solve(mid + 1, R, Sr, r);
  return;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  q = read();
  for (int i = 1; i <= q; i++)
    Q[i].a = read(), Q[i].b = read(), Q[i].c = read(), Q[i].d = read(),
    Q[i].id = i;
  solve(1, n, 1, q);
  for (int i = 1; i <= q; i++) {
    if (ans[i])
      putchar('Y'), putchar('e'), putchar('s');
    else
      putchar('N'), putchar('o');
    putchar('\n');
  }
  return 0;
}
