#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long sq(long long x) { return (x * x) % MOD; }
long long modP(long long a, long long b) {
  return (!b ? 1 : (sq(modP(a, b / 2)) * (b % 2 ? a : 1)) % MOD);
}
int n, a[maxN];
long long seg[2][4 * maxN], lazy[2][4 * maxN];
void build(int id = 1, int s = 0, int e = n) {
  if (e - s <= 1) {
    seg[0][id] = a[s];
    seg[1][id] = INF;
    return;
  }
  int md = (s + e) / 2;
  build(2 * id, s, md);
  build(2 * id + 1, md, e);
  bool b = (md - s) % 2;
  seg[0][id] = min(seg[0][2 * id], seg[b][2 * id + 1]);
  seg[1][id] = min(seg[1][2 * id], seg[!b][2 * id + 1]);
  return;
}
void update(int l, int r, int x, int id = 1, int s = 0, int e = n) {
  if (l <= s && e <= r) {
    bool b = (s - l) % 2;
    seg[b][id] += x;
    lazy[b][id] += x;
    return;
  }
  if (l >= e || s >= r) return;
  int md = (s + e) / 2;
  update(l, r, x, 2 * id, s, md);
  update(l, r, x, 2 * id + 1, md, e);
  bool b = (md - s) % 2;
  seg[0][id] = min(seg[0][2 * id], seg[b][2 * id + 1]) + lazy[0][id];
  seg[1][id] = min(seg[1][2 * id], seg[!b][2 * id + 1]) + lazy[1][id];
  return;
}
pair<long long, long long> get(int l, int r, int id = 1, int s = 0, int e = n) {
  bool b = (l - s) % 2;
  if (l <= s && e <= r) return {seg[b][id], seg[!b][id]};
  if (l >= e || s >= r) return {INF, INF};
  int md = (s + e) / 2;
  pair<long long, long long> X = get(l, r, 2 * id, s, md);
  pair<long long, long long> Y = get(l, r, 2 * id + 1, md, e);
  return {min(X.first, Y.first) + lazy[b][id],
          min(X.second, Y.second) + lazy[!b][id]};
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) a[i] -= a[i - 1];
  build();
  int q;
  cin >> q;
  while (q--) {
    int t, l, r;
    cin >> t >> l >> r;
    r++;
    if (t == 1) {
      long long x;
      cin >> x;
      update(l, r, x);
      if ((r - l) % 2) {
        update(r, n, -x);
        update(r + 1, n, x);
      }
    } else {
      long long off = (l ? get(l - 1, l).first : 0ll);
      pair<long long, long long> mn = get(l, r);
      bool flag = (mn.first >= 1 - off && mn.second >= off);
      long long lst = get(r - 1, r).first;
      if ((r - l) % 2)
        flag &= (lst + off == 1);
      else
        flag &= (lst == off);
      cout << flag << "\n";
    }
  }
  return 0;
}
