#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int N, Q, a[300010], d[300010];
namespace SegmentTree {
struct SegmentTreeNode {
  int l, r, size;
  long long sum, tag[2], D[2];
  bool f;
} tree[300010 << 2];
inline void Update(int now, bool o) {
  tree[now].D[0] = min(tree[now << 1].D[0], tree[now << 1 | 1].D[o]);
  tree[now].D[1] = min(tree[now << 1].D[1], tree[now << 1 | 1].D[o ^ 1]);
}
inline void PushDown(int now, bool o) {
  if (tree[now].l == tree[now].r) return;
  if (tree[now].tag[0])
    tree[now << 1].D[0] += tree[now].tag[0],
        tree[now << 1].tag[0] += tree[now].tag[0],
        tree[now << 1 | 1].D[o] += tree[now].tag[0],
        tree[now << 1 | 1].tag[o] += tree[now].tag[0], tree[now].tag[0] = 0;
  if (tree[now].tag[1])
    tree[now << 1].D[1] += tree[now].tag[1],
        tree[now << 1].tag[1] += tree[now].tag[1],
        tree[now << 1 | 1].D[o ^ 1] += tree[now].tag[1],
        tree[now << 1 | 1].tag[o ^ 1] += tree[now].tag[1], tree[now].tag[1] = 0;
}
inline void BuildTree(int now, int l, int r) {
  tree[now].l = l;
  tree[now].r = r;
  tree[now].size = r - l + 1;
  if (l == r) {
    tree[now].D[0] = d[l];
    tree[now].D[1] = 0x7fffffff;
    return;
  }
  int mid = (l + r) >> 1;
  BuildTree(now << 1, l, mid);
  BuildTree(now << 1 | 1, mid + 1, r);
  Update(now, tree[now << 1].size & 1);
}
inline void Modify(int now, int L, int R, long long x, bool o) {
  if (L > R) return;
  int l = tree[now].l, r = tree[now].r;
  PushDown(now, tree[now << 1].size & 1);
  if (L <= l && R >= r) {
    tree[now].tag[o] += x;
    tree[now].D[o] += x;
    return;
  }
  int mid = (l + r) >> 1;
  if (L <= mid) Modify(now << 1, L, R, x, o);
  if (R > mid) Modify(now << 1 | 1, L, R, x, o ^ (tree[now << 1].size & 1));
  Update(now, tree[now << 1].size & 1);
}
inline long long Query(int now, int L, int R, bool o) {
  if (L > R) return 0x7fffffff;
  int l = tree[now].l, r = tree[now].r;
  PushDown(now, tree[now << 1].size & 1);
  if (L <= l && R >= r) return tree[now].D[o];
  int mid = (l + r) >> 1;
  long long re = 0x7fffffff;
  if (L <= mid) re = min(re, Query(now << 1, L, R, o));
  if (R > mid)
    re = min(re, Query(now << 1 | 1, L, R, o ^ (tree[now << 1].size & 1)));
  return re;
}
}  // namespace SegmentTree
using namespace SegmentTree;
int main() {
  N = read();
  for (int i = 0; i <= N - 1; i++) a[i] = read();
  d[0] = a[0];
  for (int i = 1; i <= N - 1; i++) d[i] = a[i] - a[i - 1], a[i] -= a[i - 1];
  SegmentTree::BuildTree(1, 0, N - 1);
  Q = read();
  while (Q--) {
    int opt = read(), L = read(), R = read(), K;
    if (opt == 1) {
      K = read();
      SegmentTree::Modify(1, L, R, K, L & 1);
      if ((R - L + 1) & 1)
        SegmentTree::Modify(1, R + 1, N - 1, -K, (R + 1) & 1),
            SegmentTree::Modify(1, R + 2, N - 1, K, (R + 2) & 1);
    }
    if (opt == 2) {
      long long x = L > 0 ? SegmentTree::Query(1, L - 1, L - 1, (L - 1) & 1)
                          : 0,
                y = SegmentTree::Query(1, R, R, R & 1);
      if ((R - L + 1) & 1)
        y += x;
      else
        y -= x;
      if (y != ((R - L + 1) & 1) ||
          SegmentTree::Query(1, L, R, L & 1) + x < 1 ||
          SegmentTree::Query(1, L, R, (L & 1) ^ 1) - x < 0)
        puts("0");
      else
        puts("1");
    }
  }
  return 0;
}
