#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = (int)2e9 + 7;
const long long LINF = (long long)4e18;
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;
}
string nextString(bool flag = false) {
  char ch;
  string ans = "";
  do {
    ch = getchar();
  } while (ch <= ' ');
  while (1) {
    ans += ch;
    ch = getchar();
    if (!flag) {
      if (ch <= ' ') break;
    } else {
      if (ch < ' ') break;
    }
  }
  return ans;
}
char nextChar() {
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  return ch;
}
void read(string& s) { s = nextString(); }
void read(char& c) { c = nextChar(); }
template <typename T>
void read(T& a) {
  a = input<T>();
}
template <typename T, typename... R>
void read(T& a, R&... r) {
  read(a);
  read(r...);
}
const int N = 5e2 + 10;
const int K = 6e5 + 10;
bool a[N][N];
pair<short, short> range[N][N];
bool able[N][N];
bool ans1[K], ans2[K];
struct Q {
  int id, x1, y1, x2, y2;
  Q(int id, int x1, int y1, int x2, int y2)
      : id(id), x1(x1), y1(y1), x2(x2), y2(y2) {}
};
vector<Q> uAble[N];
vector<Q> uRange[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  read(n, m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      char x;
      read(x);
      a[i][j] = (x == '.' ? 1 : 0);
    }
  }
  int q;
  read(q);
  for (int i = 0; i < q; ++i) {
    int x1, y1, x2, y2;
    read(x1, y1, x2, y2);
    uAble[y1].push_back(Q(i, x1, y1, x2, y2));
    uRange[y2].push_back(Q(i, x1, y1, x2, y2));
  }
  for (int k = 1; k <= m; ++k) {
    if (uAble[k].size()) {
      memset(able, false, sizeof(false));
      for (int i = 1; i <= n; ++i) {
        for (int j = k; j <= m; ++j) {
          if (!a[i][j]) continue;
          if (i > 1) {
            able[i][j] |= able[i - 1][j];
          }
          if (j > k) {
            able[i][j] |= able[i][j - 1];
          } else {
            able[i][j] = true;
          }
        }
      }
      for (auto i : uAble[k]) {
        if (able[i.x2][i.y2]) ans1[i.id] = true;
      }
    }
    if (uRange[k].size()) {
      memset(range, 0, sizeof(range));
      for (int i = n; i >= 1; --i) {
        for (int j = k; j >= 1; --j) {
          if (!a[i][j]) continue;
          if (j == k) {
            range[i][j] = {i, i};
            if (a[i + 1][j]) {
              range[i][j] = {range[i + 1][j].first, i};
            }
            continue;
          }
          if (i < n && range[i + 1][j].first) {
            range[i][j] = range[i + 1][j];
          }
          if (a[i][j + 1]) {
            if (!range[i][j + 1].first) continue;
            if (range[i][j].first == 0)
              range[i][j].first = range[i][j + 1].first;
            if (!range[i][j].second) {
              range[i][j].second = range[i][j + 1].second;
            } else {
              range[i][j].second =
                  min(range[i][j].second, range[i][j + 1].second);
            }
          }
        }
      }
      for (auto i : uRange[k]) {
        if (range[i.x1][i.y1].first >= i.x2 && i.x2 >= range[i.x1][i.y1].second)
          ans2[i.id] = true;
      }
    }
  }
  for (int i = 0; i < q; ++i) {
    if (ans1[i] && ans2[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
