#include <bits/stdc++.h>
using namespace std;
struct node {
  int x2, y2;
  int id;
  friend bool operator<(const node &a, const node &b) { return a.x2 < b.x2; }
};
vector<node> query[510][510];
bitset<510> stat[510][510];
char g[510][510];
int ans[600010];
int n, m;
int qn;
void work(int l, int r) {
  int flag = 0, flag2 = 0;
  int mid = (l + r) >> 1;
  for (int i = l; i <= mid; i++)
    for (int j = 0; j < m; j++) {
      int sz = (int)(query[i][j].size());
      if (sz == 0) continue;
      if (l < r && query[i][j][sz - 1].x2 <= mid) continue;
      flag2 = 1;
    }
  int flag3 = 1;
  for (int i = l; i <= r; i++)
    for (int j = 0; j < m; j++) {
      if (query[i][j].size() > 0) flag = 1;
      if (g[i][j] == '#') flag3 = 0;
    }
  if (!flag) return;
  if (flag3) {
    for (int i = l; i <= r; i++)
      for (int j = 0; j < m; j++) {
        int sz = (int)(query[i][j].size());
        for (int k = 0; k < sz; k++) {
          ans[query[i][j][k].id] = 1;
        }
      }
    return;
  }
  if (flag2) {
    stat[mid][m].reset();
    for (int j = m - 1; j >= 0; j--)
      if (g[mid][j] == '#') {
      } else {
        stat[mid][j] = stat[mid][j + 1];
        stat[mid][j].set(j);
      }
    for (int i = mid - 1; i >= l; i--) {
      stat[i][m].reset();
      for (int j = m - 1; j >= 0; j--)
        if (g[i][j] == '#') {
        } else {
          stat[i][j] = (stat[i][j + 1] | stat[i + 1][j]);
        }
    }
    stat[mid + 1][0].reset();
    if (g[mid + 1][0] == '.') stat[mid + 1][0].set(0);
    for (int j = 1; j < m; j++)
      if (g[mid + 1][j] == '#') {
      } else {
        stat[mid + 1][j] = stat[mid + 1][j - 1];
        stat[mid + 1][j].set(j);
      }
    for (int i = mid + 2; i <= r; i++) {
      stat[i][0].reset();
      if (g[i][0] == '.') stat[i][0] = stat[i - 1][0];
      for (int j = 1; j < m; j++)
        if (g[i][j] == '#') {
        } else {
          stat[i][j] = (stat[i - 1][j] | stat[i][j - 1]);
        }
    }
    bitset<510> tmp;
    for (int i = l; i <= mid; i++)
      for (int j = 0; j < m; j++) {
        int sz = (int)(query[i][j].size());
        int x2, y2, id;
        while (sz) {
          x2 = query[i][j][sz - 1].x2;
          y2 = query[i][j][sz - 1].y2;
          id = query[i][j][sz - 1].id;
          if (l == r) {
            ans[id] = (stat[i][j][y2] > 0);
            query[i][j].pop_back();
            --sz;
          } else {
            if (x2 <= mid) break;
            tmp = (stat[i][j] & stat[x2][y2]);
            ans[id] = (tmp.count() > 0);
            query[i][j].pop_back();
            --sz;
          }
        }
      }
  }
  if (l == r) return;
  work(l, mid);
  work(mid + 1, r);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", g[i]);
  scanf("%d", &qn);
  node tmp;
  for (int t = 0; t < qn; t++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    --x1;
    --x2;
    --y1;
    --y2;
    tmp.x2 = x2;
    tmp.y2 = y2;
    tmp.id = t;
    query[x1][y1].push_back(tmp);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (query[i][j].size() > 0) sort(query[i][j].begin(), query[i][j].end());
  work(0, n - 1);
  for (int t = 0; t < qn; t++) puts(ans[t] ? "Yes" : "No");
  return 0;
}
