#include <bits/stdc++.h>
using namespace std;
const long long LINF = (1LL << 61) - 1;
const int N = 2e5 + 100;
struct Node {
  int l, r, len;
  long long minodd, mineven;
  long long sum, lazy;
  Node(int _l = 0) {
    l = _l;
    r = len = 0;
    minodd = LINF, mineven = LINF;
    sum = lazy = 0;
  }
  void out() const {
    cout << l << ' ' << r << ' ' << len << endl;
    cout << minodd << ' ' << mineven << ' ' << sum << ' ' << lazy << endl;
  }
};
Node operator+(const Node &a, const Node &b) {
  Node res;
  if (a.l == -1) return b;
  if (b.l == -1) return a;
  res.l = a.l, res.r = b.r, res.len = res.r - res.l;
  res.sum = b.sum + a.sum * (b.len & 1 ? -1 : 1);
  res.minodd = a.minodd, res.mineven = a.mineven;
  if (a.len & 1) {
    res.minodd = min(res.minodd, b.mineven + a.sum);
    res.mineven = min(res.mineven, b.minodd - a.sum);
  } else {
    res.minodd = min(res.minodd, b.minodd - a.sum);
    res.mineven = min(res.mineven, b.mineven + a.sum);
  }
  return res;
}
struct SegmentTree {
  Node node[N * 4];
  void build(int u, int l, int r, long long *v) {
    node[u].l = l, node[u].r = r, node[u].len = r - l;
    if (l + 1 == r) {
      node[u].minodd = v[l], node[u].sum = v[l];
    } else {
      build(u << 1, l, (l + r) >> 1, v);
      build(u << 1 | 1, (l + r) >> 1, r, v);
      node[u] = node[u << 1] + node[u << 1 | 1];
    }
  }
  inline void updatenode(int u, long long v) {
    if (node[u].len & 1) node[u].sum += v;
    node[u].minodd += v, node[u].lazy += v;
  }
  inline void pushdown(int u) {
    if (node[u].lazy) {
      updatenode(u << 1, node[u].lazy);
      updatenode(u << 1 | 1, node[u].lazy);
    }
    node[u].lazy = 0;
  }
  void update(int u, int l, int r, long long v) {
    if (l <= node[u].l && node[u].r <= r) {
      updatenode(u, v);
    } else if (l >= node[u].r || r <= node[u].l) {
      return;
    } else {
      pushdown(u);
      update(u << 1, l, r, v);
      update(u << 1 | 1, l, r, v);
      node[u] = node[u << 1] + node[u << 1 | 1];
    }
  }
  Node query(int u, int l, int r) {
    if (l <= node[u].l && node[u].r <= r) {
      return node[u];
    } else if (l >= node[u].r || r <= node[u].l || l + 1 == r) {
      return Node(-1);
    } else {
      pushdown(u);
      return query(u << 1, l, r) + query(u << 1 | 1, l, r);
    }
  }
} st;
int n;
long long v[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &v[i]);
  }
  st.build(1, 0, n, v);
  int q;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    ++r;
    if (t == 2) {
      Node cur = st.query(1, l, r);
      printf("%d\n", (bool)(cur.minodd >= 1 && cur.mineven >= 0 &&
                            cur.sum == (cur.len & 1)));
    } else {
      long long v;
      scanf("%lld", &v);
      st.update(1, l, r, v);
    }
  }
  return 0;
}
