#include <bits/stdc++.h>
using namespace std;
const int MAXW = 505, MAXQ = 6e5 + 10;
int w, h, q;
char mat[MAXW][MAXW];
struct pii {
  int x, y;
};
struct query {
  pii A, B;
};
query Q[MAXQ];
bool ans[MAXQ];
bitset<MAXW> able[MAXW][MAXW];
void solve(int l, int r, vector<int> cq) {
  if (cq.empty()) return;
  int m = l + r >> 1;
  if (r - l == 1) {
    for (auto i : cq) {
      auto cur = Q[i];
      int yy = cur.A.y;
      for (; yy < cur.B.y; yy++) {
        if (mat[yy][l] == '#') break;
      }
      if (mat[yy][l] == '.' && yy == cur.B.y) ans[i] = true;
    }
    return;
  }
  for (int i = 0; i < h; i++) {
    for (int j = l; j < r; j++) able[i][j].reset();
  }
  for (int i = 0; i < h; i++) {
    if (mat[i][m - 1] == '.') able[i][m - 1][i] = true;
    if (mat[i][m] == '.') able[i][m][i] = true;
  }
  for (int i = h - 1; i >= 0; i--) {
    for (int j = m - 1; j >= l; j--) {
      if (mat[i][j] == '#') continue;
      if (j + 1 < m) able[i][j] |= able[i][j + 1];
      if (i + 1 < h) able[i][j] |= able[i + 1][j];
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = m; j < r; j++) {
      if (mat[i][j] == '#') continue;
      if (i - 1 >= 0) able[i][j] |= able[i - 1][j];
      if (j - 1 >= m) able[i][j] |= able[i][j - 1];
    }
  }
  vector<int> ql, qr;
  for (auto i : cq) {
    auto &cur = Q[i];
    assert(cur.A.x >= l && cur.A.x < r && cur.B.x >= l && cur.B.x < r);
    if (cur.A.x < m && cur.B.x >= m) {
      ans[i] = (able[cur.A.y][cur.A.x] & able[cur.B.y][cur.B.x]).count() > 0;
    } else if (cur.A.x < m && cur.B.x < m)
      ql.push_back(i);
    else
      qr.push_back(i);
  }
  solve(l, m, ql);
  solve(m, r, qr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w;
  string s;
  for (int i = 0; i < h; i++) {
    cin >> s;
    for (int j = 0; j < w; j++) mat[i][j] = s[j];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> Q[i].A.y >> Q[i].A.x >> Q[i].B.y >> Q[i].B.x;
    Q[i].A.x--;
    Q[i].A.y--;
    Q[i].B.x--;
    Q[i].B.y--;
  }
  vector<int> vi;
  for (int i = 0; i < q; i++) vi.push_back(i);
  solve(0, w, vi);
  for (int i = 0; i < q; i++)
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  return 0;
}
