#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 10, MD = 1e9 + 7;
long long n, m, a[MX], ans, tmp, f[MX], mno[MX * 4], mne[MX * 4], lazye[MX * 4],
    lazyo[MX * 4], q;
void shift(int id, int s, int e) {
  long long val = lazye[id], val2 = lazyo[id];
  lazye[id] = lazyo[id] = 0;
  mne[id * 2] += val;
  mne[id * 2 + 1] += val;
  lazye[id * 2] += val;
  lazye[id * 2 + 1] += val;
  mno[id * 2] += val2;
  mno[id * 2 + 1] += val2;
  lazyo[id * 2] += val2;
  lazyo[id * 2 + 1] += val2;
}
void upde(int l, int r, long long val, int id = 1, int s = 0, int e = n) {
  if (s >= r || e <= l) return;
  if (s >= l && e <= r) {
    mne[id] += val;
    lazye[id] += val;
    return;
  }
  shift(id, s, e);
  int mid = (s + e) / 2;
  upde(l, r, val, id * 2, s, mid);
  upde(l, r, val, id * 2 + 1, mid, e);
  mne[id] = min(mne[id * 2], mne[id * 2 + 1]);
}
void updo(int l, int r, long long val, int id = 1, int s = 0, int e = n) {
  if (s >= r || e <= l) return;
  if (s >= l && e <= r) {
    mno[id] += val;
    lazyo[id] += val;
    return;
  }
  shift(id, s, e);
  int mid = (s + e) / 2;
  updo(l, r, val, id * 2, s, mid);
  updo(l, r, val, id * 2 + 1, mid, e);
  mno[id] = min(mno[id * 2], mno[id * 2 + 1]);
}
long long gete(int l, int r, int id = 1, int s = 0, int e = n) {
  if (s >= r || e <= l) return 1e16;
  if (s >= l && e <= r) return mne[id];
  shift(id, s, e);
  int mid = (s + e) / 2;
  return min(gete(l, r, id * 2, s, mid), gete(l, r, id * 2 + 1, mid, e));
}
long long geto(int l, int r, int id = 1, int s = 0, int e = n) {
  if (s >= r || e <= l) return 1e16;
  if (s >= l && e <= r) return mno[id];
  shift(id, s, e);
  int mid = (s + e) / 2;
  return min(geto(l, r, id * 2, s, mid), geto(l, r, id * 2 + 1, mid, e));
}
int main() {
  scanf("%lld", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    if (i)
      f[i] = a[i] - f[i - 1];
    else
      f[i] = a[i];
    if (i % 2) {
      updo(i, i + 1, f[i]);
      upde(i, i + 1, 1e16);
    } else {
      upde(i, i + 1, f[i]);
      updo(i, i + 1, 1e16);
    }
  }
  scanf("%lld", &q);
  for (int i = 0; i < q; i++) {
    int type, l, r;
    scanf("%d%d%d", &type, &l, &r);
    if (type == 1) {
      int k;
      scanf("%d", &k);
      if ((r - l + 1) % 2 == 0) {
        if (l % 2) {
          updo(l, r + 1, k);
        } else {
          upde(l, r + 1, k);
        }
      } else {
        if (l % 2) {
          updo(l, r + 1, k);
          upde(r + 1, n + 1, -k);
          updo(r + 1, n + 1, k);
        } else {
          upde(l, r + 1, k);
          updo(r + 1, n + 1, -k);
          upde(r + 1, n + 1, k);
        }
      }
    } else {
      long long last = 0;
      long long oddlr = geto(l, r + 1);
      long long evenlr = gete(l, r + 1);
      if (l % 2)
        last = gete(l - 1, l);
      else
        last = geto(l - 1, l);
      if (l == 0) last = 0;
      long long res = 1;
      if (l % 2) {
        if (oddlr + last < 1 || evenlr - last < 0 ||
            r % 2 && geto(r, r + 1) + last != 1 ||
            r % 2 == 0 && gete(r, r + 1) - last != 0)
          res = 0;
      } else {
        if (oddlr - last < 0 || evenlr + last < 1 ||
            r % 2 && geto(r, r + 1) - last != 0 ||
            r % 2 == 0 && gete(r, r + 1) + last != 1)
          res = 0;
      }
      printf("%lld\n", res);
    }
  }
}
