#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void read(Tp &x) {
  static char c;
  static bool neg;
  x = 0, c = getchar(), neg = false;
  for (; !isdigit(c); c = getchar()) {
    if (c == '-') {
      neg = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (neg) {
    x = -x;
  }
}
namespace Solve {
const int N = 500 + 5;
const int Q = 6e5 + 5;
int n, m, q;
bool ans[Q];
char mp[N][N];
struct Query {
  int x1, y1, x2, y2;
};
Query que[Q];
bitset<N> f[N][N], g[N][N];
void solve(int l, int r, vector<int> &id) {
  if (l > r || id.empty()) {
    return;
  }
  int mid = (l + r) >> 1;
  for (int i = 1; i <= m; ++i) {
    f[mid][i].reset();
    g[mid][i].reset();
  }
  for (int i = 1; i <= m; ++i) {
    if (mp[mid][i] == '.') {
      f[mid][i].set(i);
      f[mid][i] |= f[mid][i + 1];
      g[mid][i].set(i);
      g[mid][i] |= g[mid][i - 1];
    }
  }
  for (int i = mid - 1; i >= l; --i) {
    for (int j = m; j >= 1; --j) {
      if (mp[i][j] == '.') {
        f[i][j] = f[i + 1][j] | f[i][j + 1];
      } else {
        f[i][j].reset();
      }
    }
  }
  for (int i = mid + 1; i <= r; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (mp[i][j] == '.') {
        g[i][j] = g[i - 1][j] | g[i][j - 1];
      } else {
        g[i][j].reset();
      }
    }
  }
  vector<int> left, right;
  for (const auto &i : id) {
    if (que[i].x2 < mid) {
      left.emplace_back(i);
    } else if (que[i].x1 > mid) {
      right.emplace_back(i);
    } else {
      ans[i] = (f[que[i].x1][que[i].y1] & g[que[i].x2][que[i].y2]).any();
    }
  }
  id.clear();
  solve(l, mid, left);
  solve(mid + 1, r, right);
}
inline void main() {
  read(n), read(m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", mp[i] + 1);
  }
  read(q);
  vector<int> id;
  for (int i = 1; i <= q; ++i) {
    read(que[i].x1), read(que[i].y1), read(que[i].x2), read(que[i].y2);
    id.emplace_back(i);
  }
  solve(1, n, id);
  for (int i = 1; i <= q; ++i) {
    puts(ans[i] ? "Yes" : "No");
  }
}
}  // namespace Solve
int main() {
  Solve::main();
  return 0;
}
