#include <bits/stdc++.h>
using namespace std;
const size_t MAX_N = 2e5 + 5;
const int mult[2] = {-1, 1};
const int inve[2] = {1, -1};
const int bound[2] = {1, 0};
const int inveb[2] = {0, 1};
const int INF = 2e9;
pair<int, int> operator*(pair<int, int> a, pair<int, int> b) {
  return {min(a.first, b.first), min(a.second, b.second)};
}
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<int, int>& operator+=(pair<int, int>& a, pair<int, int> b) {
  a.first += b.first;
  a.second += b.second;
  return a;
}
int n;
pair<int, int> tree[MAX_N << 2], lazy[MAX_N << 2];
inline void add(int v, pair<int, int> val) {
  tree[v] += val;
  lazy[v] += val;
}
inline void pushDown(int v) {
  add(v << 1, lazy[v]);
  add(v << 1 | 1, lazy[v]);
  lazy[v].first = lazy[v].second = 0;
}
void push(int p, pair<int, int> val, int v = 1, int vl = 0, int vr = n) {
  if (vl + 1 == vr) {
    tree[v] = val;
    return;
  }
  int mid = (vl + vr) >> 1;
  if (p < mid)
    push(p, val, v << 1, vl, mid);
  else
    push(p, val, v << 1 | 1, mid, vr);
  tree[v] = tree[v << 1] * tree[v << 1 | 1];
}
void add(int l, int r, pair<int, int> val, int v = 1, int vl = 0, int vr = n) {
  if (vl >= r || vr <= l) return;
  if (l <= vl && vr <= r) {
    tree[v] += val;
    lazy[v] += val;
    return;
  }
  pushDown(v);
  int mid = (vl + vr) >> 1;
  add(l, r, val, v << 1, vl, mid);
  add(l, r, val, v << 1 | 1, mid, vr);
  tree[v] = tree[v << 1] * tree[v << 1 | 1];
}
pair<int, int> query(int l, int r, int v = 1, int vl = 0, int vr = n) {
  if (vl >= r || vr <= l) return {INF, INF};
  if (l <= vl && vr <= r) return tree[v];
  pushDown(v);
  int mid = (vl + vr) >> 1;
  return query(l, r, v << 1, vl, mid) * query(l, r, v << 1 | 1, mid, vr);
}
int query(int p) {
  return p & 1 ? query(p, p + 1).second : query(p, p + 1).first;
}
int main() {
  scanf("%d", &n);
  for (int i = 0, a, lst = 0; i < n; ++i) {
    scanf("%d", &a);
    push(i,
         i & 1 ? pair<int, int>(INF, a - lst) : pair<int, int>(a - lst, INF));
    lst = a - lst;
  }
  int q;
  scanf("%d", &q);
  for (int typ, a, b, k; q--;) {
    scanf("%d%d%d", &typ, &a, &b);
    ++b;
    if (typ == 1) {
      scanf("%d", &k);
      add(a, b, a & 1 ? pair<int, int>(0, k) : pair<int, int>(k, 0));
      if ((b ^ a) & 1) {
        add(b, n, pair<int, int>(k * mult[b & 1], 0));
        add(b, n, pair<int, int>(0, k * inve[b & 1]));
      }
    } else {
      int pre = (a ? query(a - 1) : 0);
      int en = (b ? query(b - 1) : 0) + mult[(a ^ b) & 1] * pre;
      pair<int, int> tmp = query(a, b);
      printf("%d\n", en == ((a ^ b) & 1) &&
                         tmp.first + inve[a & 1] * pre >= bound[a & 1] &&
                         tmp.second + mult[a & 1] * pre >= inveb[a & 1]);
    }
  }
  return 0;
}
