#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * power(a * a % md, b / 2, md) % md
                      : power(a * a % md, b / 2, md) % md));
}
const int xn = 2e5 + 10;
const int xm = -20 + 10;
const int SQ = 320;
const int sq = 320 + 10;
const int inf = 1e9 + 10;
const long long INF = 1e18 + 10;
const int mod = 1e9 + 7;
const int TM = 3;
const int base = 257;
long long n, m, a[xn], lazy[xn << 2];
pair<pair<long long, long long>, long long> seg[xn << 2],
    tohi = {{INF, INF}, 0};
pair<pair<long long, long long>, long long> merge(
    pair<pair<long long, long long>, long long> x,
    pair<pair<long long, long long>, long long> y, int l, int r, int mid) {
  pair<pair<long long, long long>, long long> z;
  y.first.first -= x.second;
  y.first.second += x.second;
  if ((r - mid) % 2)
    y.second -= x.second;
  else
    y.second += x.second;
  z.first = x.first;
  if ((mid - l) % 2) {
    z.first.first = min(z.first.first, y.first.second);
    z.first.second = min(z.first.second, y.first.first);
  } else {
    z.first.first = min(z.first.first, y.first.first);
    z.first.second = min(z.first.second, y.first.second);
  }
  z.second = y.second;
  return z;
}
void build(int id, int l, int r) {
  if (r - l == 1) {
    seg[id].first.second = INF;
    seg[id].second = seg[id].first.first = a[l] - 1;
    return;
  }
  int mid = l + r >> 1;
  build(id << 1, l, mid);
  build(id << 1 | 1, mid, r);
  seg[id] = merge(seg[id << 1], seg[id << 1 | 1], l, r, mid);
}
void shift(int id, int l, int r) {
  if (!lazy[id]) return;
  seg[id].first.first += lazy[id];
  if ((r - l) % 2) seg[id].second += lazy[id];
  if (r - l > 1) {
    lazy[id << 1] += lazy[id];
    lazy[id << 1 | 1] += lazy[id];
  }
  lazy[id] = 0;
}
void update(int id, int l, int r, int ql, int qr, long long val) {
  shift(id, l, r);
  if (qr <= l || r <= ql) return;
  if (ql <= l && r <= qr) {
    lazy[id] += val;
    shift(id, l, r);
    return;
  }
  int mid = l + r >> 1;
  update(id << 1, l, mid, ql, qr, val);
  update(id << 1 | 1, mid, r, ql, qr, val);
  seg[id] = merge(seg[id << 1], seg[id << 1 | 1], l, r, mid);
}
pair<pair<long long, long long>, long long> get(int id, int l, int r, int ql,
                                                int qr) {
  shift(id, l, r);
  if (qr <= l || r <= ql) return tohi;
  if (ql <= l && r <= qr) return seg[id];
  int mid = l + r >> 1;
  int L = max(l, ql);
  int R = min(r, qr);
  pair<pair<long long, long long>, long long> x = get(id << 1, l, mid, ql, qr);
  pair<pair<long long, long long>, long long> y =
      get(id << 1 | 1, mid, r, ql, qr);
  if (qr < mid) return x;
  if (ql > mid) return y;
  return merge(x, y, L, R, mid);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  build(1, 0, n);
  cin >> m;
  while (m--) {
    int t, l, r, x;
    cin >> t >> l >> r;
    if (t == 1) {
      cin >> x;
      update(1, 0, n, l, r + 1, x);
    } else {
      pair<pair<long long, long long>, long long> y = get(1, 0, n, l, r + 1);
      cout << bool(!y.second && y.first.first >= 0 && y.first.second >= 0)
           << '\n';
    }
  }
  return 0;
}
