#include <bits/stdc++.h>
using namespace std;
int n, m;
int A[200005], D[200005];
struct Tree {
  int Mn[200005 << 2][2], add[200005 << 2][2];
  void Up(int p, int l, int r, int op) {
    Mn[p][0] = min(Mn[l][0], Mn[r][op]);
    Mn[p][1] = min(Mn[l][1], Mn[r][op ^ 1]);
  }
  void Down(int p, int op) {
    int l = p << 1, r = p << 1 | 1;
    if (add[p][0]) {
      Mn[l][0] += add[p][0];
      add[l][0] += add[p][0];
      Mn[r][op] += add[p][0];
      add[r][op] += add[p][0];
      add[p][0] = 0;
    }
    if (add[p][1]) {
      Mn[l][1] += add[p][1];
      add[l][1] += add[p][1];
      Mn[r][op ^ 1] += add[p][1];
      add[r][op ^ 1] += add[p][1];
      add[p][1] = 0;
    }
  }
  void Build(int L, int R, int p) {
    Mn[p][0] = Mn[p][1] = 1e9;
    add[p][0] = add[p][1] = 0;
    if (L == R) {
      Mn[p][0] = D[L];
      return;
    }
    int mid = (L + R) >> 1;
    Build(L, mid, p << 1);
    Build(mid + 1, R, p << 1 | 1);
    int len = mid - L + 1;
    Up(p, p << 1, p << 1 | 1, len % 2);
  }
  void Change(int L, int R, int l, int r, int k, int p, int op) {
    if (L == l && R == r) {
      Mn[p][op] += k;
      add[p][op] += k;
      return;
    }
    int mid = (L + R) >> 1, len = mid - L + 1;
    Down(p, len % 2);
    if (mid >= r)
      Change(L, mid, l, r, k, p << 1, op);
    else if (mid < l)
      Change(mid + 1, R, l, r, k, p << 1 | 1, op ^ (len % 2));
    else
      Change(L, mid, l, mid, k, p << 1, op),
          Change(mid + 1, R, mid + 1, r, k, p << 1 | 1, op ^ (len % 2));
    Up(p, p << 1, p << 1 | 1, len % 2);
  }
  int Query(int L, int R, int l, int r, int p, int op) {
    if (L == l && R == r) return Mn[p][op];
    int mid = (L + R) >> 1, len = mid - L + 1;
    Down(p, len % 2);
    if (mid >= r)
      return Query(L, mid, l, r, p << 1, op);
    else if (mid < l)
      return Query(mid + 1, R, l, r, p << 1 | 1, op ^ (len % 2));
    else
      return min(Query(L, mid, l, mid, p << 1, op),
                 Query(mid + 1, R, mid + 1, r, p << 1 | 1, op ^ (len % 2)));
  }
} tree;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]);
  D[0] = A[0];
  for (int i = 1; i < n; i++) D[i] = A[i] - D[i - 1];
  tree.Build(0, n - 1, 1);
  scanf("%d", &m);
  while (m--) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int L, R, len;
      int k;
      scanf("%d%d%d", &L, &R, &k);
      len = R - L + 1;
      tree.Change(0, n - 1, L, R, k, 1, L % 2);
      if (len % 2) {
        if (R + 1 < n) tree.Change(0, n - 1, R + 1, n - 1, -k, 1, (R + 1) % 2);
        if (R + 2 < n) tree.Change(0, n - 1, R + 2, n - 1, k, 1, R % 2);
      }
    } else {
      int L, R, len;
      scanf("%d%d", &L, &R);
      len = R - L + 1;
      int L1 = 0, R1 = 0;
      if (L > 0) L1 = tree.Query(0, n - 1, L - 1, L - 1, 1, (L - 1) % 2);
      R1 = tree.Query(0, n - 1, R, R, 1, R % 2);
      if (len % 2)
        R1 += L1;
      else
        R1 -= L1;
      int x1 = tree.Query(0, n - 1, L, R, 1, (L % 2) ^ 1);
      int x2 = tree.Query(0, n - 1, L, R, 1, (L % 2));
      if (R1 == len % 2 && x1 - L1 >= 0 && x2 + L1 >= 1)
        puts("1");
      else
        puts("0");
    }
  }
  return 0;
}
