#include <bits/stdc++.h>
using namespace std;
const int N = 510;
int n, m, Q, ans[600010];
char a[N][N];
bitset<N> f[N][N], g[N][N];
struct Que {
  int x1, y1, x2, y2, id;
} q;
void solve(int l, int r, vector<Que> v) {
  if (l > r) return;
  int mid = l + r >> 1;
  for (int i = mid; i >= l; i--)
    for (int j = m; j >= 1; j--) {
      f[i][j] = 0;
      if (a[i][j] == '.') {
        if (i == mid)
          f[i][j][j] = 1;
        else
          f[i][j] |= f[i + 1][j];
        if (j != m) f[i][j] |= f[i][j + 1];
      }
    }
  for (int i = mid; i <= r; i++)
    for (int j = 1; j <= m; j++) {
      g[i][j] = 0;
      if (a[i][j] == '.') {
        if (i == mid)
          g[i][j][j] = 1;
        else
          g[i][j] |= g[i - 1][j];
        if (j != 1) g[i][j] |= g[i][j - 1];
      }
    }
  vector<Que> v1, v2;
  for (vector<Que>::iterator it = v.begin(); it != v.end(); it++) {
    q = *it;
    if (q.x2 < mid)
      v1.push_back(q);
    else if (q.x1 > mid)
      v2.push_back(q);
    else
      ans[q.id] = (f[q.x1][q.y1] & g[q.x2][q.y2]).any();
  }
  solve(l, mid - 1, v1);
  solve(mid + 1, r, v2);
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  vector<Que> v;
  scanf("%d", &Q);
  for (int i = 1; i <= Q; i++)
    scanf("%d%d%d%d", &q.x1, &q.y1, &q.x2, &q.y2), q.id = i, v.push_back(q);
  solve(1, n, v);
  for (int i = 1; i <= Q; i++) puts(ans[i] ? "Yes" : "No");
  return 0;
}
