#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 20;
const long long inf = 1e17;
long long a[maxn], sum[maxn * 4], mn_odd[maxn * 4], mn_even[maxn * 4],
    lazy[maxn * 4];
pair<pair<long long, long long>, pair<long long, long long> > merge(
    pair<pair<long long, long long>, pair<long long, long long> > a,
    pair<pair<long long, long long>, pair<long long, long long> > b) {
  pair<pair<long long, long long>, pair<long long, long long> > c;
  if (!a.second.second) return b;
  if (!b.second.second) return a;
  if (a.second.second % 2)
    c.second.first = a.second.first - b.second.first;
  else
    c.second.first = a.second.first + b.second.first;
  if (b.second.second % 2) {
    c.first.first = min(b.first.first, a.first.second - b.second.first);
    c.first.second = min(b.first.second, a.first.first + b.second.first);
  } else {
    c.first.second = min(a.first.second - b.second.first, b.first.second);
    c.first.first = min(a.first.first + b.second.first, b.first.first);
  }
  c.second.second = a.second.second + b.second.second;
  return c;
}
pair<pair<long long, long long>, pair<long long, long long> > f(int s, int e,
                                                                int v) {
  return {{mn_odd[v], mn_even[v]}, {sum[v], e - s}};
}
void build(int s, int e, int v) {
  if (e - s < 2) {
    sum[v] = a[s];
    mn_even[v] = a[s];
    mn_odd[v] = inf;
    return;
  }
  int m = (s + e) / 2;
  build(s, m, 2 * v);
  build(m, e, 2 * v + 1);
  pair<pair<long long, long long>, pair<long long, long long> > x =
      merge(f(s, m, 2 * v), f(m, e, 2 * v + 1));
  mn_odd[v] = x.first.first;
  mn_even[v] = x.first.second;
  sum[v] = x.second.first;
}
void shift(int s, int e, int v) {
  if (e - s > 1 && lazy[v]) {
    int m = (s + e) / 2;
    lazy[2 * v] += lazy[v];
    sum[2 * v] += lazy[v] * ((m - s) % 2);
    mn_even[2 * v] += lazy[v];
    lazy[2 * v + 1] += lazy[v];
    sum[2 * v + 1] += lazy[v] * ((e - m) % 2);
    mn_even[2 * v + 1] += lazy[v];
  }
  lazy[v] = 0;
}
void update(int l, int r, long long val, int s, int e, int v) {
  if (l <= s && e <= r) {
    lazy[v] += val;
    sum[v] += val * ((e - s) % 2);
    mn_even[v] += val;
    return;
  }
  if (r <= s || e <= l) return;
  shift(s, e, v);
  int m = (s + e) / 2;
  update(l, r, val, s, m, 2 * v);
  update(l, r, val, m, e, 2 * v + 1);
  pair<pair<long long, long long>, pair<long long, long long> > x =
      merge(f(s, m, 2 * v), f(m, e, 2 * v + 1));
  mn_odd[v] = x.first.first;
  mn_even[v] = x.first.second;
  sum[v] = x.second.first;
}
pair<pair<long long, long long>, pair<long long, long long> > get(int l, int r,
                                                                  int s, int e,
                                                                  int v) {
  if (l <= s && e <= r) return {{mn_odd[v], mn_even[v]}, {sum[v], e - s}};
  if (r <= s || e <= l) return {{inf, inf}, {0, 0}};
  shift(s, e, v);
  int m = (s + e) / 2;
  pair<pair<long long, long long>, pair<long long, long long> > a =
      get(l, r, s, m, 2 * v);
  pair<pair<long long, long long>, pair<long long, long long> > b =
      get(l, r, m, e, 2 * v + 1);
  return merge(a, b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], a[i]--;
  build(0, n, 1);
  int q;
  cin >> q;
  while (q--) {
    int x;
    cin >> x;
    if (x == 1) {
      int l, r, k;
      cin >> l >> r >> k;
      r++;
      update(l, r, k, 0, n, 1);
    } else {
      int l, r;
      cin >> l >> r;
      r++;
      pair<pair<long long, long long>, pair<long long, long long> > ans =
          get(l, r, 0, n, 1);
      if (min(ans.first.first, ans.first.second) >= 0 &&
          ans.second.first + 1 == 1)
        cout << 1 << endl;
      else
        cout << 0 << endl;
    }
  }
}
