#include <bits/stdc++.h>
using namespace std;
template <typename T>
void get_int(T &x) {
  char t = getchar();
  bool neg = false;
  x = 0;
  for (; (t > '9' || t < '0') && t != '-'; t = getchar())
    ;
  if (t == '-') neg = true, t = getchar();
  for (; t <= '9' && t >= '0'; t = getchar()) x = x * 10 + t - '0';
  if (neg) x = -x;
}
template <typename T>
void print_int(T x) {
  if (x < 0) putchar('-'), x = -x;
  short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
const int inf = 0x3f3f3f3f;
const long long Linf = 1ll << 61;
const double pi = acos(-1.0);
template <typename T>
inline void updmax(T &x, const T y) {
  if (x < y) x = y;
}
template <typename T>
inline void updmin(T &x, const T y) {
  if (x > y) x = y;
}
struct SGT {
  struct segment {
    int l, r;
    long long m[2], d[2];
  } seg[300111];
  void pushdown(int t) {
    seg[(t << 1)].d[0] += seg[t].d[0];
    seg[(t << 1)].d[1] += seg[t].d[1];
    seg[((t << 1) | 1)].d[0] += seg[t].d[0];
    seg[((t << 1) | 1)].d[1] += seg[t].d[1];
    seg[(t << 1)].m[0] += seg[t].d[0];
    seg[(t << 1)].m[1] += seg[t].d[1];
    seg[((t << 1) | 1)].m[0] += seg[t].d[0];
    seg[((t << 1) | 1)].m[1] += seg[t].d[1];
    seg[t].d[0] = seg[t].d[1] = 0;
  }
  void build(int l, int r, int t) {
    seg[t].l = l;
    seg[t].r = r;
    seg[t].d[0] = seg[t].d[1] = 0;
    seg[t].m[0] = seg[t].m[1] = 0;
    if (l == r) return;
    int mid = (l + r) >> 1;
    build(l, mid, (t << 1));
    build(mid + 1, r, ((t << 1) | 1));
  }
  void add(int l, int r, int t, int v1, int v2) {
    if (l > r) return;
    if (seg[t].l == l && seg[t].r == r) {
      seg[t].m[v1] += v2;
      seg[t].d[v1] += v2;
      return;
    }
    pushdown(t);
    int mid = (seg[t].l + seg[t].r) >> 1;
    if (r <= mid)
      add(l, r, (t << 1), v1, v2);
    else if (l > mid)
      add(l, r, ((t << 1) | 1), v1, v2);
    else {
      add(l, mid, (t << 1), v1, v2);
      add(mid + 1, r, ((t << 1) | 1), v1, v2);
    }
    seg[t].m[0] = min(seg[(t << 1)].m[0], seg[((t << 1) | 1)].m[0]);
    seg[t].m[1] = min(seg[(t << 1)].m[1], seg[((t << 1) | 1)].m[1]);
  }
  long long query(int l, int r, int t, int v) {
    if (r < seg[t].l || l > seg[t].r || l > r) return 0ll;
    if (seg[t].l == l && seg[t].r == r) return seg[t].m[v];
    pushdown(t);
    int mid = (seg[t].l + seg[t].r) >> 1;
    if (r <= mid)
      return query(l, r, (t << 1), v);
    else if (l > mid)
      return query(l, r, ((t << 1) | 1), v);
    else
      return min(query(l, mid, (t << 1), v),
                 query(mid + 1, r, ((t << 1) | 1), v));
  }
} sgt;
int a[200111], n, q;
void build() { sgt.build(1, (n >> 1) + 1, 1); }
void add(int l, int r, int t, int v1, int v2) {
  if ((l & 1) ^ v1) l++;
  if ((r & 1) ^ v1) r--;
  sgt.add((l + 1) >> 1, (r + 1) >> 1, t, v1, v2);
}
long long query(int l, int r, int t, int v) {
  if ((l & 1) ^ v) l++;
  if ((r & 1) ^ v) r--;
  return sgt.query((l + 1) >> 1, (r + 1) >> 1, t, v);
}
int main() {
  get_int(n);
  build();
  for (int i = 1; i <= n; i++) {
    get_int(a[i]);
    a[i] -= a[i - 1] + 1;
    add(i, i, 1, i & 1, a[i]);
  }
  get_int(q);
  int a, b, k, op;
  long long t1, t2;
  while (q--) {
    get_int(op), get_int(a), get_int(b);
    a++;
    b++;
    if (op == 1) {
      get_int(k);
      add(a, b, 1, a & 1, k);
      if ((a & 1) == (b & 1)) {
        add(b + 1, n, 1, a & 1, k);
        add(b + 1, n, 1, (a & 1) ^ 1, -k);
      }
    } else {
      t1 = query(a - 1, a - 1, 1, (a & 1) ^ 1);
      bool ok =
          (query(a, b, 1, (a & 1) ^ 1) >= t1) && (query(a, b, 1, a & 1) >= -t1);
      if (b & 1 == a & 1)
        t2 = query(b, b, 1, b & 1) + t1;
      else
        t2 = query(b, b, 1, b & 1) - t1;
      ok &= (t2 == 0);
      printf("%d\n", ok);
    }
  }
  return 0;
}
