#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
inline long long power(long long a, long long b) {
  long long multiply = 1;
  for (int i = (0); i < (b); i++) {
    multiply *= a;
  }
  return multiply;
}
const int maxn = 505;
int n, m;
char a[maxn][maxn];
int x, y, p, q;
bitset<maxn> upper[maxn][maxn], lower[maxn][maxn];
bool ans[6 * 100005];
struct queries {
  int x, y, p, q;
  int id;
};
void divAndConquer(int x, int y, vector<queries> &intrigues) {
  if (x > y) return;
  if (intrigues.size() == 0) return;
  int mid = (x + y) / 2;
  for (int i = mid; i >= x; i--) {
    for (int j = m; j >= 1; j--) {
      upper[i][j].reset();
      if (a[i][j] == '.') {
        if (i == mid) {
          upper[i][j].set(j);
          upper[i][j] |= upper[i][j + 1];
        } else {
          upper[i][j] |= upper[i][j + 1];
          upper[i][j] |= upper[i + 1][j];
        }
      }
    }
  }
  for (int i = mid; i <= y; i++) {
    for (int j = 1; j <= m; j++) {
      lower[i][j].reset();
      if (a[i][j] == '.') {
        if (i == mid) {
          lower[i][j].set(j);
          lower[i][j] |= lower[i][j - 1];
        } else {
          lower[i][j] |= lower[i - 1][j];
          lower[i][j] |= lower[i][j - 1];
        }
      }
    }
  }
  vector<queries> up, down;
  for (auto it : intrigues) {
    if (it.x < mid && it.p < mid)
      up.push_back(it);
    else if (it.x > mid && it.p > mid)
      down.push_back(it);
    else {
      int cnt = (upper[it.x][it.y] & lower[it.p][it.q]).count();
      ans[it.id] = (cnt > 0);
    }
  }
  divAndConquer(x, mid - 1, up);
  divAndConquer(mid + 1, y, down);
}
vector<queries> all;
int Q;
void solve() {
  divAndConquer(1, n, all);
  for (int i = (0); i < (Q); i++) {
    ans[i] ? puts("Yes") : puts("No");
  }
}
int main() {
  int test, cases = 1;
  scanf("%d%d", &n, &m);
  for (int i = (1); i < (n + 1); i++) {
    scanf("%s", a[i] + 1);
  }
  scanf("%d", &Q);
  for (int i = 0; i < Q; i++) {
    scanf("%d%d%d%d", &x, &y, &p, &q);
    all.push_back({x, y, p, q, i});
  }
  solve();
  return 0;
}
