#include <bits/stdc++.h>
using namespace std;
struct aaa {
  int xf, xs, ys, yf, id;
} aa[1000001];
int n1, n, m, ans[1000001];
vector<aaa> q;
char a[1001][1001];
bitset<501> g[501][501], f[501][501];
void solve(int l, int r, vector<aaa> v) {
  if (!v.size() || l > r) return;
  int mid = (l + r) / 2, i, j;
  for (i = mid; i >= l; i--)
    for (j = m; j; j--) {
      g[i][j].reset();
      if (a[i][j] == '#') continue;
      if (i == mid)
        g[i][j][j] = 1;
      else
        g[i][j] |= g[i + 1][j];
      if (j < m) g[i][j] |= g[i][j + 1];
    }
  for (i = mid; i <= r; i++)
    for (j = 1; j <= m; j++) {
      f[i][j].reset();
      if (a[i][j] == '#') continue;
      if (i == mid)
        f[i][j][j] = 1;
      else
        f[i][j] |= f[i - 1][j];
      if (j > 1) f[i][j] |= f[i][j - 1];
    }
  vector<aaa> v1, v2;
  for (i = 0; i < v.size(); i++) {
    aaa now = v[i];
    if (now.xs < mid)
      v1.push_back(now);
    else if (now.xf > mid)
      v2.push_back(now);
    else
      ans[now.id] = (g[now.xf][now.yf] & f[now.xs][now.ys]).any();
  }
  solve(l, mid - 1, v1);
  solve(mid + 1, r, v2);
}
int main() {
  int i;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  scanf("%d", &n1);
  for (i = 1; i <= n1; i++) {
    aa[i].id = i;
    scanf("%d%d%d%d", &aa[i].xf, &aa[i].yf, &aa[i].xs, &aa[i].ys);
    q.push_back(aa[i]);
  }
  solve(1, n, q);
  for (i = 1; i <= n1; i++)
    if (ans[i])
      puts("Yes");
    else
      puts("No");
}
