#include <bits/stdc++.h>
using namespace std;
const int N = 200005, M = N * 4;
int n, q, a[N], t, l, r, k;
struct sgt {
  long long p[M], s[M];
  void B(int l, int r, int k, bool t) {
    if (l == r) {
      if (((l & 1) && !t) || (!(l & 1) && t))
        p[k] = min(0, a[l] - a[l - 1]), s[k] = a[l] - a[l - 1];
      return;
    }
    int mid = l + r >> 1;
    B(l, mid, k << 1, t);
    B(mid + 1, r, k << 1 | 1, t);
    p[k] = min(p[k << 1], s[k << 1] + p[k << 1 | 1]);
    s[k] = s[k << 1] + s[k << 1 | 1];
  }
  void C(int l, int r, int x, int y, int k) {
    if (l == r) {
      s[k] += y;
      p[k] = min(0ll, s[k]);
      return;
    }
    int mid = l + r >> 1;
    if (x <= mid)
      C(l, mid, x, y, k << 1);
    else
      C(mid + 1, r, x, y, k << 1 | 1);
    p[k] = min(p[k << 1], s[k << 1] + p[k << 1 | 1]);
    s[k] = s[k << 1] + s[k << 1 | 1];
  }
  pair<int, int> G(int l, int r, int x, int y, int k) {
    if (l == x && y == r) return make_pair(p[k], s[k]);
    int mid = l + r >> 1;
    pair<int, int> L, R;
    if (y <= mid) return G(l, mid, x, y, k << 1);
    if (x > mid) return G(mid + 1, r, x, y, k << 1 | 1);
    L = G(l, mid, x, mid, k << 1);
    R = G(mid + 1, r, mid + 1, y, k << 1 | 1);
    return make_pair(min(L.first, L.second + R.first), L.second + R.second);
  }
  void C(int x, int y) { C(1, n, x, y, 1); }
  long long G(int x, int y) { return G(1, n, x, y, 1).first; }
  long long sum(int x, int y) { return G(1, n, x, y, 1).second; }
};
struct s_t {
  sgt p0, p1;
  long long G(int x) { return p0.sum(1, x) + p1.sum(1, x); }
  void B() {
    p0.B(1, n, 1, 0);
    p1.B(1, n, 1, 1);
  }
  void C(int x, int y) {
    if (x > n)
      return;
    else if (x & 1)
      p0.C(x, y);
    else
      p1.C(x, y);
  }
  bool c(int l, int r) {
    long long val = G(l);
    if (l == r) {
      if (val > 1)
        return 0;
      else
        return 1;
    }
    if (l & 1) {
      long long tmp = G(r);
      if (!(r & 1)) tmp = 0;
      if (p1.sum(l + 1, r) != tmp) return 0;
      if (p1.G(l + 1, r) < 0) return 0;
      if (p0.G(l + 1, r) + val < 0) return 0;
    } else {
      long long tmp = G(r);
      if (r & 1) tmp = 0;
      if (p0.sum(l + 1, r) != tmp) return 0;
      if (p0.G(l + 1, r) < 0) return 0;
      if (p1.G(l + 1, r) + val < 0) return 0;
    }
    return 1;
  }
} s;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i]--;
  s.B(), scanf("%d", &q);
  for (int _ = 1; _ <= q; _++) {
    scanf("%d", &t);
    scanf("%d", &l);
    scanf("%d", &r);
    l++, r++;
    if (t == 1)
      scanf("%d", &k), s.C(l, k), s.C(r + 1, -k);
    else
      printf("%d\n", s.c(l, r));
  }
  return 0;
}
