#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
using namespace std;
static char ibuf[1 << 20];
char *fis = ibuf, *fit = ibuf;
inline char getc() {
  return fis == fit && (fit = (fis = ibuf) + fread(ibuf, 1, 1 << 20, stdin),
                        fis == fit)
             ? EOF
             : *fis++;
}
template <typename T>
void rd(T &x) {
  int f = 0, c;
  while (!isdigit(c = getc())) f ^= !(c ^ 45);
  x = (c & 15);
  while (isdigit(c = getc())) x = x * 10 + (c & 15);
  if (f) x = -x;
}
template <typename T>
void pt(T x, int c = -1) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) pt(x / 10);
  putchar(x % 10 + 48);
  if (c != -1) putchar(c);
}
const int N = 505, MAXQ = 600005;
int n, m, ans[MAXQ];
char s[N][N];
bitset<N> f[N][N], g[N][N];
void sol(int l, int r, const vector<vector<int> > &q) {
  if (((int)(q).size()) == 0) return;
  assert(l <= r);
  vector<vector<int> > L, R;
  int mid = (l + r) >> 1;
  auto dir = [&](int x, int y) { return y < mid ? -1 : y == mid ? 0 : 1; };
  for (int i = (1); i <= (n); ++i) {
    f[i][mid].reset(), g[i][mid].reset();
    if (s[i][mid] == '.') f[i][mid].set(i), g[i][mid].set(i);
  }
  for (int i = (2); i <= (n); ++i)
    if (s[i][mid] == '.') g[i][mid] |= g[i - 1][mid];
  for (int i = (n - 1); i >= (1); --i)
    if (s[i][mid] == '.') f[i][mid] |= f[i + 1][mid];
  for (int j = (mid - 1); j >= (l); --j) {
    if (s[n][j] == '.')
      f[n][j] = f[n][j + 1];
    else
      f[n][j].reset();
    for (int i = (n - 1); i >= (1); --i) {
      if (s[i][j] == '.')
        f[i][j] = f[i + 1][j] | f[i][j + 1];
      else
        f[i][j].reset();
    }
  }
  for (int j = (mid + 1); j <= (r); ++j) {
    if (s[1][j] == '.')
      g[1][j] = g[1][j - 1];
    else
      g[1][j].reset();
    for (int i = (2); i <= (n); ++i) {
      if (s[i][j] == '.')
        g[i][j] = g[i - 1][j] | g[i][j - 1];
      else
        g[i][j].reset();
    }
  }
  for (auto k : q) {
    int k1 = dir(k[0], k[1]);
    int k2 = dir(k[2], k[3]);
    if (!k1 || !k2 || (k1 < 0 && k2 > 0))
      ans[k[4]] = (f[k[0]][k[1]] & g[k[2]][k[3]]).any();
    else if (k1 < 0)
      L.push_back(k);
    else
      R.push_back(k);
  }
  sol(l, mid - 1, L), sol(mid + 1, r, R);
}
int main() {
  rd(n), rd(m);
  for (int i = (1); i <= (n); ++i)
    for (int j = (1); j <= (m); ++j) {
      while (s[i][j] = getc(), s[i][j] != '.' && s[i][j] != '#')
        ;
    }
  int Q;
  rd(Q);
  vector<vector<int> > q;
  for (int i = (1); i <= (Q); ++i) {
    int a, b, c, d;
    rd(a), rd(b), rd(c), rd(d);
    if (a > c || b > d)
      ans[i] = 0;
    else
      q.push_back({a, b, c, d, i});
  }
  sol(1, m, q);
  for (int i = (1); i <= (Q); ++i) puts(ans[i] ? "Yes" : "No");
  return 0;
}
