#include <bits/stdc++.h>
using namespace std;
const int maxn = 200003, base = 7, mod = 1000000009;
int n, Q, a[maxn], b[maxn], tot, ha[maxn], pw[maxn];
char s[maxn];
int main() {
  scanf("%d%s%d", &n, s + 1, &Q);
  for (int i = n, j = n + 1; i >= 1; i--) {
    if (s[i] == '0') {
      a[++tot] = i;
      b[tot] = ((j - i - 1) & 1) + 1;
      j = i;
    }
  }
  reverse(a + 1, a + tot + 1), reverse(b + 1, b + tot + 1);
  pw[0] = 1;
  for (int i = 1; i <= tot; i++)
    ha[i] = ((long long)ha[i - 1] * base + b[i]) % mod,
    pw[i] = (long long)pw[i - 1] * base % mod;
  while (Q--) {
    int l, r, k;
    scanf("%d%d%d", &l, &r, &k);
    int x = lower_bound(a + 1, a + tot + 1, l) - a - 1,
        y = upper_bound(a + 1, a + tot + 1, l + k - 1) - a - 1;
    int h1 = (ha[y] - (long long)ha[x] * pw[y - x] % mod + mod) % mod;
    if (x < y) {
      h1 = (h1 - b[y] + 3) % mod;
      if ((a[y] - l) & 1) h1 = (h1 + 19260817) % mod;
    }
    x = lower_bound(a + 1, a + tot + 1, r) - a - 1,
    y = upper_bound(a + 1, a + tot + 1, r + k - 1) - a - 1;
    int h2 = (ha[y] - (long long)ha[x] * pw[y - x] % mod + mod) % mod;
    if (x < y) {
      h2 = (h2 - b[y] + 3) % mod;
      if ((a[y] - r) & 1) h2 = (h2 + 19260817) % mod;
    }
    puts(h1 == h2 ? "Yes" : "No");
  }
  return 0;
}
