#include <bits/stdc++.h>
using namespace std;
const int N = 666;
struct Node {
  int xl, xr, yl, yr, id;
} t[N * N * 2], p[N * N * 2];
bool g[N][N], ans[N * N * 2];
bitset<N> f1[N][N], f2[N][N], res;
int n, m, q;
inline void rd(int& x) {
  char ch;
  x = 0;
  while ((ch = getchar()) < 48)
    ;
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
}
inline void solve(int l, int r, int lo, int ro) {
  if (l > r || lo > ro) return;
  int mid = (l + r) >> 1, p1 = lo - 1, p2 = ro + 1, i, j;
  for (int i = 1; i <= m; i++) f1[mid][i] = f2[mid][i] = 0;
  for (int i = m; i >= 1; i--)
    if (g[mid][i]) {
      f1[mid][i][i] = 1;
      f1[mid][i] |= f1[mid][i + 1];
    }
  for (int i = 1; i <= m; i++)
    if (g[mid][i]) {
      f2[mid][i][i] = 1;
      f2[mid][i] |= f2[mid][i - 1];
    }
  for (i = mid - 1; i >= l; i--)
    for (j = m; j >= 1; j--) {
      if (!g[i][j]) {
        f1[i][j] = 0;
        continue;
      }
      f1[i][j] = f1[i + 1][j] | f1[i][j + 1];
    }
  for (i = mid + 1; i <= r; i++)
    for (j = 1; j <= m; j++) {
      if (!g[i][j]) {
        f2[i][j] = 0;
        continue;
      }
      f2[i][j] = f2[i - 1][j] | f2[i][j - 1];
    }
  for (i = lo; i <= ro; i++) {
    if (t[i].xr < mid) {
      p[++p1] = t[i];
      continue;
    }
    if (t[i].xl > mid) {
      p[--p2] = t[i];
      continue;
    }
    res = f1[t[i].xl][t[i].yl] & f2[t[i].xr][t[i].yr];
    if (res.any())
      ans[t[i].id] = 1;
    else
      ans[t[i].id] = 0;
  }
  for (i = lo; i <= ro; i++) t[i] = p[i];
  solve(l, mid - 1, lo, p1);
  solve(mid + 1, r, p2, ro);
}
int main() {
  rd(n);
  rd(m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char ch;
      while (1) {
        ch = getchar();
        if (ch == '#' || ch == '.') break;
      }
      if (ch == '.')
        g[i][j] = 1;
      else
        g[i][j] = 0;
    }
  rd(q);
  for (int i = 1; i <= q; i++) {
    rd(t[i].xl);
    rd(t[i].yl);
    rd(t[i].xr);
    rd(t[i].yr);
    t[i].id = i;
  }
  solve(1, n, 1, q);
  for (int i = 1; i <= q; i++)
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  return 0;
}
