#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch = getchar();
  int x = 0, fl = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') fl = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch - '0');
  return x * fl;
}
const int NN = 500 + 17;
const int MM = 600000 + 17;
void open() {
  freopen("a.in", "r", stdin);
  freopen("a.out", "w", stdout);
}
int n, m, q;
char mp[NN][NN];
bool ans[MM];
bitset<NN> f[NN][NN], g[NN][NN];
struct node {
  int x1, Herciertxdy, x2, y2, id;
  node(int _x1 = 0, int _y1 = 0, int _x2 = 0, int _y2 = 0, int _id = 0) {
    x1 = _x1;
    Herciertxdy = _y1;
    x2 = _x2;
    y2 = _y2;
    id = _id;
  }
};
vector<node> query;
void work(int l, int r, vector<node> cur) {
  if (l > r) return;
  int mid = (l + r) >> 1;
  for (int i = mid; i >= l; i--)
    for (int j = m; j >= 1; j--) {
      f[i][j].reset();
      if (mp[i][j] != '#') {
        if (i == mid)
          f[i][j][j] = 1;
        else
          f[i][j] |= f[i + 1][j];
        if (j < m) {
          f[i][j] |= f[i][j + 1];
        }
      }
    }
  for (int i = mid; i <= r; i++)
    for (int j = 1; j <= m; j++) {
      g[i][j].reset();
      if (mp[i][j] != '#') {
        if (i == mid)
          g[i][j][j] = 1;
        else
          g[i][j] |= g[i - 1][j];
        if (j > 1) {
          g[i][j] |= g[i][j - 1];
        }
      }
    }
  vector<node> ql, qr;
  ql.clear();
  qr.clear();
  for (int i = 0, top = cur.size(); i < top; i++) {
    int x1 = cur[i].x1, Herciertxdy = cur[i].Herciertxdy, x2 = cur[i].x2,
        y2 = cur[i].y2, id = cur[i].id;
    if (x2 < mid) {
      ql.push_back(cur[i]);
    } else if (x1 > mid) {
      qr.push_back(cur[i]);
    } else {
      ans[id] = (f[x1][Herciertxdy] & g[x2][y2]).any();
    }
  }
  work(l, mid - 1, ql);
  work(mid + 1, r, qr);
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", mp[i] + 1);
  }
  q = read();
  for (int i = 1; i <= q; i++) {
    int x1 = read(), Herciertxdy = read(), x2 = read(), y2 = read();
    query.push_back(node(x1, Herciertxdy, x2, y2, i));
  }
  work(1, n, query);
  for (int i = 1; i <= q; i++) {
    printf(ans[i] ? "Yes\n" : "No\n");
  }
  return 0;
}
