#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  char ch = getchar();
  x = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
}
const int N = 2e5 + 5, o = 2333, mod = 998244353;
int n, q, m, c[N];
char a[N];
long long s[N][2], p[N];
long long ask(int l, int r) {
  int t = l & 1;
  l = c[l - 1] + 1, r = c[r];
  return ((s[r][t] - s[l - 1][t] * p[r - l + 1]) % mod + mod) % mod;
}
signed main() {
  scanf("%d %s %d", &n, a + 1, &q);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = p[i - 1] * o % mod;
  for (int i = 1; i <= n; ++i) {
    if (a[i] == '0') {
      ++m;
      s[m][0] = ((s[m - 1][0] * o + 1 + (i & 1)) % mod);
      s[m][1] = ((s[m - 1][1] * o + 2 - (i & 1)) % mod);
    }
    c[i] = m;
  }
  for (int i = 1, l, x, y; i <= q; ++i) {
    read(x), read(y), read(l);
    puts(ask(x, x + l - 1) == ask(y, y + l - 1) ? "Yes" : "No");
  }
  return 0;
}
