#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)5e2 + 10;
const int maxK = (int)6e5 + 10;
const int mod = (int)1e9 + 7;
const int INF = (int)1e9 + 5;
const long long LLINF = (long long)1e18 + 5;
struct query {
  int x1, x2;
  int idx;
  query() {}
  query(int x1, int x2, int idx) : x1(x1), x2(x2), idx(idx) {}
};
int n, m, q;
char s[maxN][maxN];
bitset<maxN> dpLeft[maxN][maxN];
bitset<maxN> dpRight[maxN][maxN];
vector<query> queries[maxN][maxN];
int answer[maxK];
void solve(int l, int r) {
  int m = (l + r) / 2;
  for (int i = 1; i <= n; ++i) {
    for (int j = l - 1; j <= r + 1; ++j) {
      dpLeft[i][j].reset();
      dpRight[i][j].reset();
    }
  }
  for (int i = 1; i <= n; ++i) {
    dpLeft[i][m][i] = (s[i][m] == '.' ? 1 : 0);
    dpRight[i][m][i] = (s[i][m] == '.' ? 1 : 0);
  }
  for (int j = m; j >= l; --j) {
    for (int i = n; i >= 1; --i) {
      if (s[i][j] == '#') continue;
      dpLeft[i][j] |= dpLeft[i + 1][j] | dpLeft[i][j + 1];
    }
  }
  for (int j = m; j <= r; ++j) {
    for (int i = 1; i <= n; ++i) {
      if (s[i][j] == '#') continue;
      dpRight[i][j] |= dpRight[i - 1][j] | dpRight[i][j - 1];
    }
  }
  for (int y1 = l; y1 <= m; ++y1) {
    for (int y2 = m; y2 <= r; ++y2) {
      if (queries[y1][y2].empty()) continue;
      for (auto x : queries[y1][y2]) {
        answer[x.idx] = (dpLeft[x.x1][y1] & dpRight[x.x2][y2]).any();
      }
      queries[y1][y2].clear();
    }
  }
  if (l == r) return;
  solve(l, m);
  solve(m + 1, r);
}
int main() {
  n = nextInt<int>();
  m = nextInt<int>();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      s[i][j] = getchar();
    }
    getchar();
  }
  q = nextInt<int>();
  for (int i = 0; i < q; ++i) {
    int x1 = nextInt<int>();
    int y1 = nextInt<int>();
    int x2 = nextInt<int>();
    int y2 = nextInt<int>();
    queries[y1][y2].push_back(query(x1, x2, i));
  }
  solve(1, m);
  for (int i = 0; i < q; ++i) {
    puts(answer[i] ? "Yes" : "No");
  }
  return 0;
}
