#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void next_int(T &x) {
  x = 0;
  char c;
  bool neg = false;
  while (!isdigit(c = getchar()))
    if (c == '-') neg = true;
  do x = x * 10 + c - 48;
  while (isdigit(c = getchar()));
  if (neg) x = -x;
}
template <typename T>
inline void write_int(T x, char last = 0) {
  if (x < 0) putchar('-'), x = abs(x);
  char tmp[20];
  int cnt = 0;
  while (x >= 10) tmp[cnt++] = x % 10 + 48, x /= 10;
  tmp[cnt] = x + 48;
  for (int i = (cnt); i >= (0); --i) putchar(tmp[i]);
  if (last) putchar(last);
}
struct data {
  long long odd, even, last;
  int sz;
} tree[2][1 << 19], emp;
const long long oo = (long long)1e18 + 7;
const int N = (int)2e5 + 5;
int n, m;
long long a[2][N], lazy[2][1 << 19];
data combine(data x, data y) {
  if (!x.sz || !y.sz) return x.sz ? x : y;
  data c;
  c.sz = x.sz + y.sz;
  if (y.sz & 1)
    c.last = y.last - x.last;
  else
    c.last = y.last + x.last;
  if (x.sz & 1) {
    c.odd = min(x.odd, x.last + y.even);
    c.even = min(x.even, y.odd - x.last);
  } else {
    c.odd = min(x.odd, y.odd - x.last);
    c.even = min(x.even, y.even + x.last);
  }
  return c;
}
void build_tree(int id, int k, int l, int r) {
  if (l > r) return;
  if (l == r) {
    tree[id][k].odd = tree[id][k].last = a[id][l];
    tree[id][k].even = oo, tree[id][k].sz = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build_tree(id, k << 1, l, mid);
  build_tree(id, k << 1 | 1, mid + 1, r);
  tree[id][k] = combine(tree[id][k << 1], tree[id][k << 1 | 1]);
}
void lazy_update(int id, int k, int l, int r) {
  if (!lazy[id][k]) return;
  tree[id][k].odd += lazy[id][k];
  if (tree[id][k].sz & 1) tree[id][k].last += lazy[id][k];
  if (l != r) {
    lazy[id][k << 1] += lazy[id][k];
    lazy[id][k << 1 | 1] += lazy[id][k];
  }
  lazy[id][k] = 0;
}
void update(int id, int k, int l, int r, int L, int R, long long val) {
  lazy_update(id, k, l, r);
  if (l > r || l > R || r < L) return;
  if (L <= l && r <= R) {
    lazy[id][k] = val;
    lazy_update(id, k, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  update(id, k << 1, l, mid, L, R, val);
  update(id, k << 1 | 1, mid + 1, r, L, R, val);
  tree[id][k] = combine(tree[id][k << 1], tree[id][k << 1 | 1]);
}
data query(int id, int k, int l, int r, int L, int R) {
  lazy_update(id, k, l, r);
  if (l > r || l > R || r < L) return emp;
  if (L <= l && r <= R) return tree[id][k];
  int mid = (l + r) >> 1;
  return combine(query(id, k << 1, l, mid, L, R),
                 query(id, k << 1 | 1, mid + 1, r, L, R));
}
int main() {
  next_int(n);
  for (int i = (1); i <= (n); ++i) next_int(a[0][i]), a[1][i] = a[0][i];
  reverse(a[1] + 1, a[1] + n + 1);
  build_tree(0, 1, 1, n);
  next_int(m);
  while (m--) {
    int type, x, y, z;
    next_int(type), next_int(x), next_int(y), ++x, ++y;
    if (type == 1) {
      next_int(z);
      update(0, 1, 1, n, x, y, z);
    } else {
      int res = 0;
      data ans = query(0, 1, 1, n, x, y);
      if (ans.odd >= 1 && ans.even >= 0 && ans.last == (ans.sz & 1)) res = 1;
      write_int(res, '\n');
    }
  }
  return 0;
}
