#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int size = 31;
const int mod = 1e8 + 7;
long long hash1[maxn], jec[maxn], hash2[maxn];
int cnt[maxn];
char s[maxn];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s + 1);
  jec[0] = 1;
  for (int i = 1; i <= n; ++i) jec[i] = jec[i - 1] * size % mod;
  for (int i = 1; i <= n; ++i) cnt[i] = cnt[i - 1] + !(s[i] - '0');
  for (int i = 1; i <= n; ++i) {
    if (s[i] == '0') {
      hash1[i] = hash1[i - 1] * size + ((i & 1) + '0');
      hash2[i] = hash2[i - 1] * size + !(i & 1) + '0';
      hash1[i] %= mod;
      hash2[i] %= mod;
    } else {
      hash1[i] = hash1[i - 1];
      hash2[i] = hash2[i - 1];
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r, len;
    scanf("%d%d%d", &l, &r, &len);
    long long p, pp;
    if (l & 1)
      p = (hash1[l + len - 1] -
           hash1[l - 1] * jec[cnt[l + len - 1] - cnt[l - 1]] % mod + mod) %
          mod;
    else
      p = (hash2[l + len - 1] -
           hash2[l - 1] * jec[cnt[l + len - 1] - cnt[l - 1]] % mod + mod) %
          mod;
    if (r & 1)
      pp = (hash1[r + len - 1] -
            hash1[r - 1] * jec[cnt[r + len - 1] - cnt[r - 1]] % mod + mod) %
           mod;
    else
      pp = (hash2[r + len - 1] -
            hash2[r - 1] * jec[cnt[r + len - 1] - cnt[r - 1]] % mod + mod) %
           mod;
    if (p == pp)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
