#include <bits/stdc++.h>
using namespace std;
const long long MXN = 2e5 + 10;
const long long MXS = MXN * 4;
long long q, n, Oln, Eln;
long long A[MXN];
long long Lazy[2][MXS], MIN[2][MXS];
void Build(long long typ, long long id, long long s, long long e) {
  if ((e - s + 1) == 1) {
    MIN[typ][id] = A[s * 2 + typ];
    return;
  }
  Build(typ, (id * 2), s, ((s + e) / 2)),
      Build(typ, (id * 2 + 1), ((s + e) / 2 + 1), e);
  MIN[typ][id] = min(MIN[typ][(id * 2)], MIN[typ][(id * 2 + 1)]);
}
inline void Shift(long long typ, long long id, long long s, long long e) {
  if (!Lazy[typ][id]) return;
  MIN[typ][id] += Lazy[typ][id];
  if ((e - s + 1) > 1) {
    Lazy[typ][(id * 2)] += Lazy[typ][id],
        Lazy[typ][(id * 2 + 1)] += Lazy[typ][id];
  }
  Lazy[typ][id] = 0;
}
void Upd(long long typ, long long l, long long r, long long val, long long id,
         long long s, long long e) {
  Shift(typ, id, s, e);
  if (e < l || s > r) return;
  if (l <= s && e <= r) {
    Lazy[typ][id] += val;
    Shift(typ, id, s, e);
    return;
  }
  Upd(typ, l, r, val, (id * 2), s, ((s + e) / 2)),
      Upd(typ, l, r, val, (id * 2 + 1), ((s + e) / 2 + 1), e);
  MIN[typ][id] = min(MIN[typ][(id * 2)], MIN[typ][(id * 2 + 1)]);
}
long long Get(long long typ, long long l, long long r, long long id,
              long long s, long long e) {
  Shift(typ, id, s, e);
  if (e < l || s > r) return 1e13;
  if (l <= s && e <= r) return MIN[typ][id];
  return min(Get(typ, l, r, (id * 2), s, ((s + e) / 2)),
             Get(typ, l, r, (id * 2 + 1), ((s + e) / 2 + 1), e));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n, Eln = Oln = n / 2, Eln += (n % 2);
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 1; i < n; i++) A[i] -= A[i - 1];
  Build(0, 1, 0, Eln), Build(1, 1, 0, Oln);
  cin >> q;
  while (q--) {
    long long typ, l, r, x, sz;
    cin >> typ >> l >> r, sz = r - l + 1;
    if (typ == 1) {
      cin >> x;
      Upd(l % 2, l / 2, (r - (sz % 2 == 0)) / 2, x, 1, 0, (l % 2 ? Oln : Eln));
      if (sz % 2 == 0) continue;
      Upd((r + 1) % 2, (r + 1) / 2, ((r + 1) % 2 ? Oln : Eln), -x, 1, 0,
          ((r + 1) % 2 ? Oln : Eln));
      Upd((r + 2) % 2, (r + 2) / 2, ((r + 2) % 2 ? Oln : Eln), +x, 1, 0,
          ((r + 2) % 2 ? Oln : Eln));
      continue;
    }
    if (l) {
      long long ind = l - 1;
      long long past =
          Get(ind % 2, ind / 2, ind / 2, 1, 0, (ind % 2 ? Oln : Eln));
      Upd(l % 2, l / 2, (r - (sz % 2 == 0)) / 2, past, 1, 0,
          (l % 2 ? Oln : Eln));
      Upd((l + 1) % 2, (l + 1) / 2, (r - (sz % 2 == 1)) / 2, -past, 1, 0,
          ((l + 1) % 2 ? Oln : Eln));
    }
    long long MinE =
        Get(l % 2, l / 2, (r - (sz % 2 == 0)) / 2, 1, 0, (l % 2 ? Oln : Eln));
    long long MinO = Get((l + 1) % 2, (l + 1) / 2, (r - (sz % 2 == 1)) / 2, 1,
                         0, ((l + 1) % 2 ? Oln : Eln));
    cout << (MinE >= 1 && MinO >= 0 &&
             Get(r % 2, r / 2, r / 2, 1, 0, (r % 2 ? Oln : Eln)) == (sz % 2))
         << '\n';
    if (l) {
      long long ind = l - 1;
      long long past =
          Get(ind % 2, ind / 2, ind / 2, 1, 0, (ind % 2 ? Oln : Eln));
      Upd(l % 2, l / 2, (r - (sz % 2 == 0)) / 2, -past, 1, 0,
          (l % 2 ? Oln : Eln));
      Upd((l + 1) % 2, (l + 1) / 2, (r - (sz % 2 == 1)) / 2, past, 1, 0,
          ((l + 1) % 2 ? Oln : Eln));
    }
  }
  return 0;
}
