#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  char ch = getchar(), flag = 0;
  while ((ch > '9' || ch < '0') && ch != '-') ch = getchar();
  if (ch == '-') flag = 1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  if (flag) x = -x;
}
inline void read(int &x, int &y) { read(x), read(y); }
inline void read(int &x, int &y, int &z) { read(x), read(y), read(z); }
const int N = 200005, M = N * 4;
int n, q, a[N];
struct sgt {
  long long p[M], s[M];
  void build(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;
    build(l, mid, k << 1, t);
    build(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 change(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)
      change(l, mid, x, y, k << 1);
    else
      change(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<long long, long long> get(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<long long, long long> L, R;
    if (y <= mid) return get(l, mid, x, y, k << 1);
    if (x > mid) return get(mid + 1, r, x, y, k << 1 | 1);
    L = get(l, mid, x, mid, k << 1);
    R = get(mid + 1, r, mid + 1, y, k << 1 | 1);
    return make_pair(min(L.first, L.second + R.first), L.second + R.second);
  }
  void change(int x, int y) { change(1, n, x, y, 1); }
  long long get(int x, int y) { return get(1, n, x, y, 1).first; }
  long long sum(int x, int y) { return get(1, n, x, y, 1).second; }
};
struct segment_tree {
  sgt p0, p1;
  long long get(int x) { return p0.sum(1, x) + p1.sum(1, x); }
  void build() {
    p0.build(1, n, 1, 0);
    p1.build(1, n, 1, 1);
  }
  void change(int x, int y) {
    if (x > n)
      return;
    else if (x & 1)
      p0.change(x, y);
    else
      p1.change(x, y);
  }
  bool check(int l, int r) {
    long long val = get(l);
    if (l == r) {
      if (val > 1)
        return 0;
      else
        return 1;
    }
    if (val + p0.sum(l + 1, r) + p1.sum(l + 1, r) - get(r) != 0) puts("WA");
    if (l & 1) {
      long long tmp = get(r);
      if (!(r & 1)) tmp = 0;
      if (p1.sum(l + 1, r) != tmp) return 0;
      if (p1.get(l + 1, r) < 0) return 0;
      if (p0.get(l + 1, r) + val < 0) return 0;
    } else {
      long long tmp = get(r);
      if (r & 1) tmp = 0;
      if (p0.sum(l + 1, r) != tmp) return 0;
      if (p0.get(l + 1, r) < 0) return 0;
      if (p1.get(l + 1, r) + val < 0) return 0;
    }
    return 1;
  }
} s;
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]), a[i]--;
  s.build();
  read(q);
  int cnt = 0;
  for (int _ = 1; _ <= q; _++) {
    int typ, l, r, k;
    read(typ, l, r);
    l++, r++;
    if (typ == 2) cnt++;
    if (typ == 1) {
      read(k);
      s.change(l, k);
      s.change(r + 1, -k);
    } else
      printf("%d\n", s.check(l, r));
  }
  return 0;
}
