#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5, Mod = 1e9 + 7, MAXN = 1e5, Lg = 27, M = 1e7 + 10,
                P = 727, Sq = 320;
const long long Inf = 3e18 + 10;
long long LzE[4 * N], LzO[4 * N], E[4 * N], O[4 * N], A[N], B[N], n, q;
void Shift(long long s, long long e, long long ind) {
  long long x = LzE[ind], y = LzO[ind];
  E[(2 * (ind))] += x, E[((2 * (ind)) + 1)] += x, LzE[(2 * (ind))] += x,
      LzE[((2 * (ind)) + 1)] += x;
  O[(2 * (ind))] += y, O[((2 * (ind)) + 1)] += y, LzO[(2 * (ind))] += y,
      LzO[((2 * (ind)) + 1)] += y;
  LzE[ind] = LzO[ind] = 0;
}
long long MinEven(long long s, long long e, long long ind, long long l,
                  long long r) {
  if (l >= e || r <= s) return Inf;
  if (s >= l && e <= r) return E[ind];
  Shift(s, e, ind);
  long long mid = (s + e) / 2;
  return min(MinEven(s, mid, (2 * (ind)), l, r),
             MinEven(mid, e, ((2 * (ind)) + 1), l, r));
}
void Even(long long s, long long e, long long ind, long long l, long long r,
          long long x) {
  if (l >= e || r <= s) return;
  if (s >= l && e <= r) {
    E[ind] += x, LzE[ind] += x;
    return;
  }
  Shift(s, e, ind);
  long long mid = (s + e) / 2;
  Even(s, mid, (2 * (ind)), l, r, x);
  Even(mid, e, ((2 * (ind)) + 1), l, r, x);
  E[ind] = min(E[(2 * (ind))], E[((2 * (ind)) + 1)]);
}
long long MinOdd(long long s, long long e, long long ind, long long l,
                 long long r) {
  if (l >= e || r <= s) return Inf;
  if (s >= l && e <= r) return O[ind];
  Shift(s, e, ind);
  long long mid = (s + e) / 2;
  return min(MinOdd(s, mid, (2 * (ind)), l, r),
             MinOdd(mid, e, ((2 * (ind)) + 1), l, r));
}
void Odd(long long s, long long e, long long ind, long long l, long long r,
         long long x) {
  if (l >= e || r <= s) return;
  if (s >= l && e <= r) {
    O[ind] += x, LzO[ind] += x;
    return;
  }
  Shift(s, e, ind);
  long long mid = (s + e) / 2;
  Odd(s, mid, (2 * (ind)), l, r, x);
  Odd(mid, e, ((2 * (ind)) + 1), l, r, x);
  O[ind] = min(O[(2 * (ind))], O[((2 * (ind)) + 1)]);
}
int32_t main() {
  scanf("%lld", &n);
  for (long long i = 1; i <= n; i++) scanf("%lld", &A[i]);
  for (long long i = 1; i <= n; i++) {
    B[i] = A[i] - B[i - 1];
    if (i % 2) {
      Even(1, n + 1, 1, i, i + 1, Inf);
      Odd(1, n + 1, 1, i, i + 1, B[i]);
    }
    if (!(i % 2)) {
      Odd(1, n + 1, 1, i, i + 1, Inf);
      Even(1, n + 1, 1, i, i + 1, B[i]);
    }
  }
  scanf("%lld", &q);
  for (long long i = 1; i <= q; i++) {
    long long t, x, y, k;
    scanf("%lld%lld%lld", &t, &x, &y);
    x++, y++;
    if (t ^ 2) {
      scanf("%lld", &k);
      if (x % 2) Odd(1, n + 1, 1, x, y + 1, k);
      if (!(x % 2)) Even(1, n + 1, 1, x, y + 1, k);
      if (x % 2 == y % 2) {
        if (x % 2) {
          Even(1, n + 1, 1, y + 1, n + 1, -k);
          Odd(1, n + 1, 1, y + 1, n + 1, k);
        }
        if (!(x % 2)) {
          Odd(1, n + 1, 1, y + 1, n + 1, -k);
          Even(1, n + 1, 1, y + 1, n + 1, k);
        }
      }
    }
    if (t ^ 1) {
      long long lst = 0;
      if (x > 1) {
        if (x % 2) lst = MinEven(1, n + 1, 1, x - 1, x);
        if (!(x % 2)) lst = MinOdd(1, n + 1, 1, x - 1, x);
      }
      long long sw = 1;
      if (x % 2) {
        if (MinOdd(1, n + 1, 1, x, y + 1) + lst < 1) sw = 0;
        if (MinEven(1, n + 1, 1, x, y + 1) - lst < 0) sw = 0;
        if (y % 2 && MinOdd(1, n + 1, 1, y, y + 1) + lst != 1) sw = 0;
        if (!(y % 2) && MinEven(1, n + 1, 1, y, y + 1) - lst != 0) sw = 0;
      }
      if (!(x % 2)) {
        if (MinEven(1, n + 1, 1, x, y + 1) + lst < 1) sw = 0;
        if (MinOdd(1, n + 1, 1, x, y + 1) - lst < 0) sw = 0;
        if (!(y % 2) && MinEven(1, n + 1, 1, y, y + 1) + lst != 1) sw = 0;
        if (y % 2 && MinOdd(1, n + 1, 1, y, y + 1) - lst != 0) sw = 0;
      }
      printf("%lld\n", sw);
    }
  }
  return 0;
}
