#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
template <typename T>
inline T Abs(T x) {
  return (x >= 0) ? x : -x;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
string toStr(T x) {
  stringstream st;
  st << x;
  string s;
  st >> s;
  return s;
}
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
const int MAXN = 520;
const int MAXQ = 600100;
const int OSN = 511;
struct query {
  int x1, YYYYYYYYYYYY1, x2, y2, id;
  query(int x1 = 0, int YYYYYYYYYYYY1 = 0, int x2 = 0, int y2 = 0, int id = 0)
      : x1(x1), YYYYYYYYYYYY1(YYYYYYYYYYYY1), x2(x2), y2(y2), id(id) {}
};
bitset<MAXN> lf[MAXN][MAXN], rg[MAXN][MAXN];
vector<query> p[2 * OSN + 10];
string a[MAXN];
bool ans[MAXQ];
int n, m, q;
void process(int v, int l, int r) {
  if (l == r) return;
  int mid = (l + r) >> 1;
  process(2 * v + 1, l, mid);
  process(2 * v + 2, mid + 1, r);
  for (int i = 0; i < (int)(p[v].size()); i++) {
    query q = p[v][i];
    bitset<MAXN> tmp = rg[q.x1][q.YYYYYYYYYYYY1];
    tmp &= lf[q.x2][q.y2];
    ans[q.id] = (tmp.count() != 0);
  }
  for (int x = mid; x >= l; x--)
    for (int y = (int)(m)-1; y >= 0; y--)
      if (a[x][y] == '.') {
        rg[x][y] = rg[x + 1][y];
        if (y < m - 1) rg[x][y] |= rg[x][y + 1];
      }
  for (int x = mid + 1; x <= r; x++)
    for (int y = 0; y < (int)(m); y++)
      if (a[x][y] == '.') {
        lf[x][y] = lf[x - 1][y];
        if (y > 0) lf[x][y] |= lf[x][y - 1];
      }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
    while ((int)a[i].size() <= OSN) a[i] += '#';
    for (int j = 0; j < (int)(m); j++)
      if (a[i][j] == '.') {
        lf[i][j].set(j, true);
        rg[i][j].set(j, true);
      }
    for (int j = (int)(m)-1; j >= 0; j--)
      if (a[i][j] == '.' && j < m - 1) rg[i][j] |= rg[i][j + 1];
    for (int j = 0; j < (int)(m); j++)
      if (a[i][j] == '.' && j > 0) lf[i][j] |= lf[i][j - 1];
  }
  for (int i = n; i <= OSN; i++) a[i] = string(OSN, '#');
  cin >> q;
  for (int i = 0; i < (int)(q); i++) {
    int x1, YYYYYYYYYYYY1, x2, y2;
    scanf("%d%d%d%d", &x1, &YYYYYYYYYYYY1, &x2, &y2);
    x1--;
    YYYYYYYYYYYY1--;
    x2--;
    y2--;
    if (x1 == x2 && YYYYYYYYYYYY1 <= y2)
      ans[i] = rg[x1][YYYYYYYYYYYY1].test(y2);
    if (x1 < x2 && YYYYYYYYYYYY1 <= y2) {
      int t1 = x1 + OSN, t2 = x2 + OSN;
      while (t1 != t2) {
        t1 = (t1 - 1) >> 1;
        t2 = (t2 - 1) >> 1;
      }
      p[t1].push_back(query(x1, YYYYYYYYYYYY1, x2, y2, i));
    }
  }
  process(0, 0, OSN);
  for (int i = 0; i < (int)(q); i++) printf(ans[i] ? "Yes\n" : "No\n");
  cerr << clock() * 1.0 / CLOCKS_PER_SEC << endl;
  return 0;
}
