#include <bits/stdc++.h>
using namespace std;
const int N = 505, M = 6e5 + 5;
int n, m;
struct qw {
  int a, b, c, d, id;
} q[M], lb[M], lc[M], ld[M];
int ans[M];
bitset<N> g[N], f1[N][N], f2[N][N];
void cdq(int ql, int qr, int al, int ar) {
  if (ql > qr) return;
  int topb = 0, topc = 0, topd = 0, mid = al + ar >> 1;
  for (int i = ql; i <= qr; i++) {
    if (q[i].a > mid)
      ld[++topd] = q[i];
    else if (q[i].c < mid)
      lc[++topc] = q[i];
    else
      lb[++topb] = q[i];
  }
  if (topb) {
    for (int j = 1; j <= m; j++) f1[mid][j].reset(), f2[mid][j].reset();
    for (int i = m; i; 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 (int i = mid - 1; i >= al; i--)
      for (int j = m; j; j--)
        if (g[i][j] == 1)
          f1[i][j] = (f1[i + 1][j] | f1[i][j + 1]);
        else
          f1[i][j] = 0;
    for (int i = mid + 1; i <= ar; i++)
      for (int j = 1; j <= m; j++)
        if (g[i][j] == 1)
          f2[i][j] = (f2[i - 1][j] | f2[i][j - 1]);
        else
          f2[i][j] = 0;
    for (int i = 1; i <= topb; i++)
      if ((f1[lb[i].a][lb[i].b] & f2[lb[i].c][lb[i].d]).any())
        ans[lb[i].id] = 1;
  }
  if (al == ar) return;
  for (int i = 1; i <= topc; i++) q[ql + i - 1] = lc[i];
  for (int i = 1; i <= topd; i++) q[ql + topc + i - 1] = ld[i];
  cdq(ql, ql + topc - 1, al, mid);
  cdq(ql + topc, ql + topc + topd - 1, mid + 1, ar);
}
int read() {
  char ch;
  int x;
  while ((ch = getchar()) < '0' || ch > '9')
    ;
  x = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') x = x * 10 + ch - '0';
  return x;
}
int main() {
  cin >> n >> m;
  char s[N];
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    g[i].reset();
    for (int j = 1; j <= m; j++)
      if (s[j] == '.') g[i][j] = 1;
  }
  int T;
  cin >> T;
  for (int i = 1; i <= T; i++)
    q[i].a = read(), q[i].b = read(), q[i].c = read(), q[i].d = read(),
    q[i].id = i;
  cdq(1, T, 1, n);
  for (int i = 1; i <= T; i++)
    if (ans[i])
      puts("Yes");
    else
      puts("No");
  return 0;
}
