#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long _x = 0;
  int _ch = getchar(), _f = 1;
  for (; !isdigit(_ch) && (_ch != '-') && (_ch != EOF); _ch = getchar())
    ;
  if (_ch == '-') {
    _f = 0;
    _ch = getchar();
  }
  for (; isdigit(_ch); _ch = getchar()) _x = _x * 10 + _ch - '0';
  return _f ? _x : -_x;
}
void write(long long _x) {
  if (_x >= 10)
    write(_x / 10), putchar(_x % 10 + '0');
  else
    putchar(_x + '0');
}
inline void wrt(long long _x, char _p) {
  if (_x < 0) putchar('-'), _x = -_x;
  write(_x);
  if (_p) putchar(_p);
}
bitset<505> f[505][505], g[505][505];
struct Query {
  int x1, y1, x2, y2, id;
};
bool a[505][505];
bool Ans[600005];
int n, m;
void DP(int l, int r) {
  int mid = (l + r) >> 1;
  for (int i = int(l); i <= (int)(r); i++) {
    for (int j = int(1); j <= (int)(m); j++) {
      f[i][j].reset(0);
      g[i][j].reset(0);
    }
  }
  for (int j = int(m); j >= (int)(1); j--) {
    if (a[mid][j]) f[mid][j] = f[mid][j + 1], f[mid][j].set(j, 1);
  }
  for (int j = int(1); j <= (int)(m); j++) {
    if (a[mid][j]) g[mid][j] = g[mid][j - 1], g[mid][j].set(j, 1);
  }
  for (int i = int(mid - 1); i >= (int)(l); i--) {
    for (int j = int(m); j >= (int)(1); j--) {
      if (a[i][j]) f[i][j] = f[i + 1][j] | f[i][j + 1];
    }
  }
  for (int i = int(mid + 1); i <= (int)(r); i++) {
    for (int j = int(1); j <= (int)(m); j++) {
      if (a[i][j]) g[i][j] = g[i - 1][j] | g[i][j - 1];
    }
  }
}
void solve(int l, int r, vector<Query> vt) {
  DP(l, r);
  int mid = (l + r) >> 1;
  vector<Query> L, R;
  for (auto i : vt) {
    if (i.x1 <= mid && i.x2 >= mid)
      Ans[i.id] = (f[i.x1][i.y1] & g[i.x2][i.y2]).count();
    else if (i.x2 < mid)
      L.push_back(i);
    else
      R.push_back(i);
  }
  if (l == r) return;
  solve(l, mid, L), solve(mid + 1, r, R);
}
char s[505];
int Q;
int main() {
  n = rd(), m = rd();
  for (int i = int(1); i <= (int)(n); i++) {
    scanf("%s", s + 1);
    for (int j = int(1); j <= (int)(m); j++) {
      a[i][j] = s[j] == '.';
    }
  }
  Q = rd();
  vector<Query> vt;
  for (int I = int(1); I <= (int)(Q); I++) {
    int x = rd(), y = rd(), xx = rd(), yy = rd();
    vt.push_back((Query){x, y, xx, yy, I});
  }
  solve(1, n, vt);
  for (int i = int(1); i <= (int)(Q); i++) {
    if (Ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
}
