#include <bits/stdc++.h>
using namespace std;
bool dbg = 0;
void bad(string mes = "Impossible") {
  cout << mes;
  exit(0);
}
template <typename T>
string bin(T x, int st = 2) {
  string ans = "";
  while (x > 0) {
    ans += char('0' + x % st);
    x /= st;
  }
  reverse(ans.begin(), ans.end());
  return ans.empty() ? "0" : ans;
}
template <typename T>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (!((c >= '0' && c <= '9') || c == '-')) {
    c = getchar();
  }
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + (c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
void read(T& a) {
  a = input<T>();
}
template <typename T>
void read(T& a, T& b) {
  read(a), read(b);
}
template <typename T>
void read(T& a, T& b, T& c) {
  read(a, b), read(c);
}
template <typename T>
void read(T& a, T& b, T& c, T& d) {
  read(a, b), read(c, d);
}
const int inf = 2e9;
const long double eps = 1e-12;
const int maxn = 5e2 + 12, base = 1e9 + 7;
const long long llinf = 4e18 + 5;
template <typename T>
T binpow(T n, T second) {
  if (second <= 0) return 1LL;
  if (second % 2 == 0) {
    T b = binpow(n, second / 2);
    return (1LL * b * b) % base;
  } else {
    return (1LL * binpow(n, second - 1) * n) % base;
  }
}
void amax(int& x, int y) { x = max(x, y); }
void amin(int& x, int y) { x = min(x, y); }
vector<pair<pair<pair<int, int>, int>, pair<int, int> > > answers;
int a[maxn][maxn];
pair<pair<int, int>, pair<int, int> > query[(int)6e5 + 100];
pair<int, int> dp[maxn][maxn][2];
bool dp2[maxn][maxn][maxn], need[maxn][maxn][maxn];
int main() {
  int n, m;
  read(n, m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      char c = '\n';
      while (c == '\n') c = getchar();
      a[i][j] = c == '.';
    }
  int q;
  read(q);
  for (int i = 0; i < q; i++) {
    int x1, y1, x2, y2;
    read(x1, y1, x2, y2);
    x1--, y1--, x2--, y2--;
    query[i] = make_pair(make_pair(x1, y1), make_pair(x2, y2));
    need[x1][y1][y2] = 1;
    need[x2][y2][x1] = 1;
  }
  int t = 0;
  for (int j = m - 1; j >= 0; j--) {
    for (int i = n - 1; i >= 0; i--)
      for (int k = j; k < m; k++) {
        dp[i][k][t] = make_pair(inf, -inf);
        if (!a[i][j]) continue;
        if (k == j) {
          dp[i][k][t] = make_pair(i, i);
          amax(dp[i][k][t].second, dp[i + 1][k][t].second);
          if (need[i][j][k])
            answers.push_back(
                make_pair(make_pair(make_pair(i, j), k), dp[i][k][t]));
          continue;
        }
        if (a[i][j + 1]) {
          amin(dp[i][k][t].first, dp[i][k][t ^ 1].first);
          amax(dp[i][k][t].second, dp[i][k][t ^ 1].second);
        }
        if (a[i + 1][j]) {
          amin(dp[i][k][t].first, dp[i + 1][k][t].first);
          amax(dp[i][k][t].second, dp[i + 1][k][t].second);
        }
        if (need[i][j][k])
          answers.push_back(
              make_pair(make_pair(make_pair(i, j), k), dp[i][k][t]));
      }
    t ^= 1;
  }
  sort((answers).begin(), (answers).end());
  for (int j = 0; j < m; j++)
    for (int i = 0; i < n; i++)
      for (int k = 0; k <= j; k++) {
        if (!a[i][j]) continue;
        if (k == j) {
          dp2[i][j][k] = 1;
          continue;
        }
        if (j && a[i][j - 1]) dp2[i][j][k] |= dp2[i][j - 1][k];
        if (i && a[i - 1][j]) dp2[i][j][k] |= dp2[i - 1][j][k];
      }
  for (int i = 0; i < q; i++) {
    int x1 = query[i].first.first, y1 = query[i].first.second,
        x2 = query[i].second.first, y2 = query[i].second.second;
    int pos = lower_bound((answers).begin(), (answers).end(),
                          make_pair(make_pair(make_pair(x1, y1), y2),
                                    make_pair(-inf, -inf))) -
              answers.begin();
    pair<int, int> range = answers[pos].second;
    if (range.first <= x2 && x2 <= range.second && dp2[x2][y2][y1]) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
  return 0;
}
