#include <bits/stdc++.h>
const long long MAX_N = 2e5 + 100;
const long long MOD = 1e9 + 7;
const long long delta = 10333;
using namespace std;
long long mn[MAX_N * 2][2];
long long lazy[MAX_N * 2][2];
long long a[MAX_N];
long long b[MAX_N];
long long s[2];
int n, q, m, t;
void update(int k, int d) { mn[k][d] = min(mn[k * 2][d], mn[k * 2 + 1][d]); }
void shift(int k, int d) {
  int l = k * 2;
  int r = k * 2 + 1;
  lazy[l][d] += lazy[k][d];
  lazy[r][d] += lazy[k][d];
  mn[l][d] += lazy[k][d];
  mn[r][d] += lazy[k][d];
  lazy[k][d] = 0;
}
void build(int l, int r, int k, int d) {
  if (l > r) return;
  if (l == r) {
    mn[k][d] = b[l * 2 - d];
    return;
  }
  int mid = (l + r) / 2;
  build(l, mid, k * 2, d);
  build(mid + 1, r, k * 2 + 1, d);
  update(k, d);
}
void add(int l, int r, int a, int b, int k, int d, long long x) {
  if (r < a or b < l) return;
  if (a <= l and r <= b) {
    lazy[k][d] += x;
    mn[k][d] += x;
    return;
  }
  int mid = (l + r) / 2;
  shift(k, d);
  add(l, mid, a, b, k * 2, d, x);
  add(mid + 1, r, a, b, k * 2 + 1, d, x);
  update(k, d);
}
long long ask(int l, int r, int a, int b, int k, int d) {
  if (r < a or b < l) return 1e18;
  if (a <= l and r <= b) return mn[k][d];
  int mid = (l + r) / 2;
  shift(k, d);
  return min(ask(l, mid, a, b, k * 2, d), ask(mid + 1, r, a, b, k * 2 + 1, d));
}
int cv(int x) { return (x + 1) / 2; }
long long gt(int x) {
  if (!x) return 0;
  long long f = ask(1, s[x & 1], cv(x), cv(x), 1, x & 1);
  return f;
}
bool check(int l, int r) {
  long long x = gt(l - 1);
  if (ask(1, s[l & 1], cv(l), cv(r - (l % 2 != r % 2)), 1, l & 1) + x - 1 < 0)
    return false;
  long long m1 = 0;
  if (l < r)
    m1 = ask(1, s[(l + 1) & 1], cv(l + 1), cv(r - (r % 2 == l % 2)), 1,
             (l + 1) & 1) -
         x;
  if (m1 < 0) return false;
  if (l % 2 == r % 2) {
    if (gt(r) + x == 1) return true;
    return false;
  } else {
    if (gt(r) == x) return true;
    return false;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) b[i] = a[i] - b[i - 1];
  s[0] = n / 2;
  s[1] = n - s[0];
  build(1, s[0], 1, 0);
  build(1, s[1], 1, 1);
  cin >> q;
  while (q--) {
    int t;
    scanf("%d", &t);
    if (t == 1) {
      int l, r, k;
      scanf("%d%d%d", &l, &r, &k);
      l++, r++;
      add(1, s[l & 1], cv(l), cv(r - (l % 2 != r % 2)), 1, l & 1, k);
      if ((r - l + 1) % 2) {
        if (r < n)
          add(1, s[(r + 1) & 1], cv(r + 1), cv(n - (n % 2 == r % 2)), 1,
              (r + 1) & 1, -k);
        if (r + 1 < n)
          add(1, s[r & 1], cv(r + 2), cv(n - (n % 2 != r % 2)), 1, r & 1, k);
      }
    } else {
      int l, r;
      scanf("%d%d", &l, &r);
      l++, r++;
      if (r == l) {
        if (gt(r) - gt(r - 1) == 1)
          printf("1\n");
        else
          printf("0\n");
        continue;
      }
      if (gt(l) + gt(l - 1) == 0 or gt(r) + gt(r - 1) == 0) {
        printf("0\n");
        continue;
      }
      if (check(l, r))
        printf("1\n");
      else
        printf("0\n");
    }
  }
  return 0;
}
