#include <bits/stdc++.h>
using namespace std;
const int N = 505;
const int M = 600005;
int n, m, q;
int a[N][N];
int ans[M];
struct node {
  int a, b, c, d;
  int id;
} e[M], k[M];
bitset<N> f1[N][N], f2[N][N];
void work(int l, int r, int x, int y) {
  if (l > r || x > y) return;
  int mid = (l + r) / 2;
  for (int i = 1; i <= m; i++) f1[mid][i] = f2[mid][i] = 0;
  for (int i = m; i; --i)
    if (!a[mid][i]) {
      f1[mid][i][i] = 1;
      f1[mid][i] |= f1[mid][i + 1];
    }
  for (int i = mid - 1; i >= l; i--)
    for (int j = m; j; j--)
      if (!a[i][j])
        f1[i][j] = f1[i + 1][j] | f1[i][j + 1];
      else
        f1[i][j] = 0;
  for (int i = 1; i <= m; i++)
    if (!a[mid][i]) {
      f2[mid][i][i] = 1;
      f2[mid][i] |= f2[mid][i - 1];
    }
  for (int i = mid + 1; i <= r; i++)
    for (int j = 1; j <= m; j++)
      if (!a[i][j])
        f2[i][j] = f2[i - 1][j] | f2[i][j - 1];
      else
        f2[i][j] = 0;
  int u = x - 1, v = y + 1;
  for (int i = x; i <= y; i++)
    if (e[i].c < mid)
      k[++u] = e[i];
    else if (e[i].a > mid)
      k[--v] = e[i];
    else
      ans[e[i].id] = (f1[e[i].a][e[i].b] & f2[e[i].c][e[i].d]).any();
  for (int i = x; i <= u; i++) e[i] = k[i];
  work(l, mid - 1, x, u);
  for (int i = v; i <= y; i++) e[i] = k[i];
  work(mid + 1, r, v, y);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    char s[N];
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++)
      if (s[j] == '.')
        a[i][j] = 0;
      else
        a[i][j] = 1;
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d%d%d", &e[i].a, &e[i].b, &e[i].c, &e[i].d), e[i].id = i;
  }
  work(1, n, 1, q);
  for (int i = 1; i <= q; i++) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
