#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 507;
const int MAXQ = 600007;
int n, m, q;
int qxl[MAXQ], qxr[MAXQ], qyl[MAXQ], qyr[MAXQ];
bool ans[MAXQ];
char s[MAXN][MAXN];
bitset<MAXN> dpl[MAXN][MAXN], dpr[MAXN][MAXN];
int idq[MAXQ], tl[MAXQ], tr[MAXQ];
void init();
void input();
void work();
void divi(int l, int r, int ql, int qr);
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i)
    scanf("%d%d%d%d", &qxl[i], &qyl[i], &qxr[i], &qyr[i]);
}
void work() {
  for (int i = 1; i <= q; ++i) idq[i] = i;
  divi(1, n, 1, q);
  for (int i = 1; i <= q; ++i) printf(ans[i] ? "Yes\n" : "No\n");
}
void divi(int l, int r, int ql, int qr) {
  if (ql > qr) return;
  int mid = (l + r) >> 1;
  for (int i = m; i > 0; --i) {
    if (s[mid][i] == '.') {
      dpl[mid][i] = dpl[mid][i + 1];
      dpl[mid][i][i] = 1;
    } else
      dpl[mid][i] = 0;
  }
  for (int i = 1; i <= m; ++i) {
    if (s[mid][i] == '.') {
      dpr[mid][i] = dpr[mid][i - 1];
      dpr[mid][i][i] = 1;
    } else
      dpr[mid][i] = 0;
  }
  for (int i = mid - 1; i >= l; --i)
    for (int j = m; j > 0; --j)
      dpl[i][j] = (s[i][j] == '.') ? (dpl[i + 1][j] | dpl[i][j + 1]) : 0;
  for (int i = mid + 1; i <= r; ++i)
    for (int j = 1; j <= m; ++j)
      dpr[i][j] = (s[i][j] == '.') ? (dpr[i - 1][j] | dpr[i][j - 1]) : 0;
  int now, cl = 0, cr = 0;
  for (int i = ql; i <= qr; ++i) {
    now = idq[i];
    if (qxl[now] <= mid && qxr[now] >= mid) {
      ans[now] = (dpl[qxl[now]][qyl[now]] & dpr[qxr[now]][qyr[now]]).any();
    } else if (qxr[now] < mid)
      tl[cl++] = now;
    else
      tr[cr++] = now;
  }
  for (int i = 0; i < cl; ++i) idq[ql + i] = tl[i];
  for (int i = 0; i < cr; ++i) idq[ql + cl + i] = tr[i];
  divi(l, mid - 1, ql, ql + cl - 1);
  divi(mid + 1, r, ql + cl, ql + cl + cr - 1);
}
