#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const int Minf = 0x7f7f7f7f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const long long MINF = 0x7f7f7f7f7f7f7f7fll;
const int N = 505;
const int Q = 600060;
struct node {
  int sx, sy, ex, ey;
  int id;
  node(int a, int b, int c, int d, int e) {
    sx = a;
    sy = b, ex = c, ey = d, id = e;
  }
  node() {}
};
char s[N][N];
int ans[Q];
vector<node> qe;
bitset<N> r1[N][N], r2[N][N], t;
int n, m;
void divide(int l, int r, vector<node> q) {
  if (l > r || q.size() == 0) return;
  int mid = (l + r) >> 1;
  for (int i = (l - 1); i <= mid + 1; ++i)
    for (int j = (1); j <= m; ++j) r1[i][j].reset();
  for (int i = (m); i >= 1; --i) {
    if (s[mid][i] == '.' && s[mid][i + 1] == '.') r1[mid][i] |= r1[mid][i + 1];
    if (s[mid][i] == '.') r1[mid][i][i] = 1;
  }
  for (int i = (mid - 1); i >= l; --i)
    for (int j = (m); j >= 1; --j) {
      if (s[i][j] == '.') {
        if (s[i + 1][j] == '.') r1[i][j] |= r1[i + 1][j];
        if (s[i][j + 1] == '.') r1[i][j] |= r1[i][j + 1];
      }
    }
  for (int i = (mid - 1); i <= r + 1; ++i)
    for (int j = (1); j <= m; ++j) r2[i][j].reset();
  for (int i = (1); i <= m; ++i) {
    if (s[mid][i] == '.' && s[mid][i - 1] == '.') r2[mid][i] |= r2[mid][i - 1];
    if (s[mid][i] == '.') r2[mid][i][i] = 1;
  }
  for (int i = (mid + 1); i <= r; ++i)
    for (int j = (1); j <= m; ++j) {
      if (s[i][j] == '.') {
        if (s[i - 1][j] == '.') r2[i][j] |= r2[i - 1][j];
        if (s[i][j - 1] == '.') r2[i][j] |= r2[i][j - 1];
      }
    }
  vector<node> ql, qr;
  for (node p : q) {
    if (p.sx <= mid && p.ex >= mid) {
      t = r1[p.sx][p.sy] & r2[p.ex][p.ey];
      if (t.any()) ans[p.id] = 1;
    } else if (p.sx < mid && p.ex < mid) {
      ql.push_back(p);
    } else
      qr.push_back(p);
  }
  divide(l, mid - 1, ql);
  divide(mid + 1, r, qr);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= n; ++i) scanf("%s", s[i] + 1);
  int q, sx, sy, ex, ey;
  scanf("%d", &q);
  for (int i = (1); i <= q; ++i)
    scanf("%d%d%d%d", &sx, &sy, &ex, &ey),
        qe.push_back(node(sx, sy, ex, ey, i));
  divide(1, n, qe);
  for (int i = (1); i <= q; ++i) {
    if (ans[i] == 1)
      puts("Yes");
    else
      puts("No");
  }
}
