#include <bits/stdc++.h>
using namespace std;
const int N = 505;
struct IO {
  IO() {}
  inline bool is(char c) { return c >= '0' && c <= '9'; }
  inline int read() {
    char c;
    while (!is(c = getchar()))
      ;
    int num = c - '0';
    while (is(c = getchar())) num = num * 10 + c - '0';
    return num;
  }
  inline void out(long long x) {
    if (x == 0) {
      printf("0\n");
      return;
    }
    char tmp[20];
    int cnt = 0;
    while (x) {
      tmp[cnt++] = x % 10 + '0';
      x /= 10;
    }
    for (int i = cnt - 1; i >= 0; i--) printf("%c", tmp[i]);
    printf("\n");
  }
} FAST;
const int BIT = 62;
const int CNT = N / 62 + 1;
vector<int> Q[N][N];
int n;
int m;
int q;
int last[N][N];
char M[N][N];
long long dp[2][CNT + 2][N][N];
int ans[600005];
struct query {
  int x1, y1, x2, y2;
  query(int _x1 = 0, int _y1 = 0, int _x2 = 0, int _y2 = 0)
      : x1(_x1), y1(_y1), x2(_x2), y2(_y2) {}
} QQ[600005];
double beg;
inline void load() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", M[i]);
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int x1, y1, x2, y2;
    x1 = FAST.read();
    y1 = FAST.read();
    x2 = FAST.read();
    y2 = FAST.read();
    x1--;
    y1--;
    x2--;
    y2--;
    QQ[i] = query(x1, y1, x2, y2);
  }
  fprintf(stderr, "pravo11 == %.2lf\n", (clock() - beg) / CLOCKS_PER_SEC);
}
void rek(int x, int y) {
  if (x > y) return;
  fprintf(stderr, "x, y == %d %d\n", x, y);
  int mid = (x + y) / 2;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = mid; j >= x; j--) {
      if (M[i][j] == '#') continue;
      for (int ff = 0; ff <= CNT; ff++) dp[0][ff][i][j] = 0;
      if (j == mid) dp[0][i / BIT][i][j] |= (1LL << (i % BIT));
      if (j + 1 <= mid && M[i][j + 1] != '#') {
        for (int ff = 0; ff <= CNT; ff++)
          dp[0][ff][i][j] |= dp[0][ff][i][j + 1];
      }
      if (i + 1 < n && M[i + 1][j] != '#') {
        for (int ff = 0; ff <= CNT; ff++)
          dp[0][ff][i][j] |= dp[0][ff][i + 1][j];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = mid; j <= y; j++) {
      if (M[i][j] == '#') continue;
      for (int ff = 0; ff <= CNT; ff++) dp[1][ff][i][j] = 0;
      if (j == mid) dp[1][i / BIT][i][j] |= (1LL << (i % BIT));
      if (j - 1 >= mid && M[i][j - 1] != '#') {
        for (int ff = 0; ff <= CNT; ff++)
          dp[1][ff][i][j] |= dp[1][ff][i][j - 1];
      }
      if (i - 1 >= 0 && M[i - 1][j] != '#') {
        for (int ff = 0; ff <= CNT; ff++)
          dp[1][ff][i][j] |= dp[1][ff][i - 1][j];
      }
    }
  }
  for (int i = 0; i < q; i++) {
    int x1 = QQ[i].x1;
    int y1 = QQ[i].y1;
    int x2 = QQ[i].x2;
    int y2 = QQ[i].y2;
    if (y1 >= x && y1 <= mid && y2 >= mid && y2 <= y) {
      for (int ff = 0; ff <= CNT; ff++) {
        if (dp[0][ff][x1][y1] & dp[1][ff][x2][y2]) {
          ans[i] = 1;
          break;
        }
      }
    }
  }
  fprintf(stderr, "pravo u rek == %.2lf\n", (clock() - beg) / CLOCKS_PER_SEC);
  rek(x, mid - 1);
  rek(mid + 1, y);
}
inline void solve() {
  rek(0, m - 1);
  for (int i = 0; i < q; i++) {
    printf("%s\n", ans[i] ? "Yes" : "No");
  }
}
int main(void) {
  beg = clock();
  load();
  solve();
  fprintf(stderr, "pravo == %.2lf\n", (clock() - beg) / CLOCKS_PER_SEC);
  return 0;
}
