#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
struct tree {
  int n;
  struct node {
    long long sum[2], mn[2], down[2];
    node() {
      memset(sum, 0, sizeof sum);
      memset(down, 0, sizeof down);
      mn[0] = mn[1] = inf;
    }
  };
  int cnt(int l, int r, int type) { return (r - l + 2 - (l % 2 != type)) / 2; }
  void down(int v, int tl, int tr) {
    int tm = (tl + tr) / 2;
    int l[] = {tl, tm + 1};
    int r[] = {tm, tr};
    for (int i = 0; i < 2; ++i) {
      for (int c = 0; c < 2; ++c) {
        int child = 2 * v + c;
        t[child].down[i] += t[v].down[i];
        t[child].sum[i] += 1LL * t[v].down[i] * cnt(l[c], r[c], i);
        t[child].mn[i] += t[v].down[i];
      }
      t[v].down[i] = 0;
    }
  }
  node up(node a, node b) {
    node result;
    for (int i = 0; i < 2; ++i) {
      result.sum[i] = a.sum[i] + b.sum[i];
      result.mn[i] = min(a.mn[i], b.mn[i]);
    }
    return result;
  }
  vector<node> t;
  tree(int n) : n(n), t(4 * n) {}
  void build(vector<int>& a, int v, int l, int r) {
    if (l == r) {
      if (l & 1) {
        t[v].sum[1] = a[l];
        t[v].mn[1] = a[l];
      } else {
        t[v].sum[0] = a[l];
        t[v].mn[0] = a[l];
      }
      return;
    }
    int m = (l + r) / 2;
    build(a, 2 * v, l, m);
    build(a, 2 * v + 1, m + 1, r);
    t[v] = up(t[2 * v], t[2 * v + 1]);
  }
  void upd(int v, int tl, int tr, int l, int r, long long v1, long long v2) {
    if (tl > r || tr < l) return;
    if (tl >= l && tr <= r) {
      for (int i = 0; i < 2; ++i) {
        long long now = (!i ? v1 : v2);
        t[v].down[i] += now;
        t[v].sum[i] += 1LL * now * cnt(tl, tr, i);
        if (t[v].mn[i] != inf) t[v].mn[i] += now;
      }
      return;
    }
    int tm = (tl + tr) / 2;
    down(v, tl, tr);
    upd(2 * v, tl, tm, l, r, v1, v2);
    upd(2 * v + 1, tm + 1, tr, l, r, v1, v2);
    t[v] = up(t[2 * v], t[2 * v + 1]);
  }
  void upd(int l, int r, long long v1, long long v2) {
    upd(1, 0, n - 1, l, r, v1, v2);
  }
  node go(int v, int tl, int tr, int l, int r) {
    if (l > tr || r < tl) return node();
    if (l <= tl && r >= tr) return t[v];
    int tm = (tl + tr) / 2;
    down(v, tl, tr);
    return up(go(2 * v, tl, tm, l, r), go(2 * v + 1, tm + 1, tr, l, r));
  }
  bool check(int l, int r) {
    node now = go(1, 0, n - 1, l, r);
    node c1 = go(1, 0, n - 1, r, r);
    node c2 = go(1, 0, n - 1, l - 1, l - 1);
    long long c = c2.sum[0] + c2.sum[1];
    long long sum = c1.sum[0] + c1.sum[1];
    if (l & 1) {
      now.mn[1] += c;
      now.mn[0] -= c;
    } else {
      now.mn[0] += c;
      now.mn[1] -= c;
    }
    if (l % 2 != r % 2) {
      sum -= c;
    } else {
      sum += c;
    }
    return !sum && min(now.mn[0], now.mn[1]) >= 0;
  }
};
struct Test {
  tree t;
  int n, m;
  vector<int> a;
  Test(int n) : n(n), a(n), t(n) {
    for (auto& item : a) {
      cin >> item;
    }
  }
  void run() {
    for (int i = 0; i < n; ++i) {
      --a[i];
      if (i > 0) a[i] -= a[i - 1];
    }
    t.build(a, 1, 0, n - 1);
    cin >> m;
    for (int i = 0; i < m; ++i) {
      int type, l, r;
      cin >> type >> l >> r;
      if (type == 1) {
        int now;
        cin >> now;
        int size = (r - l + 1);
        if (l & 1) {
          t.upd(l, r, 0, +now);
          if (size & 1) {
            t.upd(r + 1, n - 1, -now, +now);
          }
        } else {
          t.upd(l, r, +now, 0);
          if (size & 1) {
            t.upd(r + 1, n - 1, +now, -now);
          }
        }
      } else {
        cout << t.check(l, r) << '\n';
      }
    }
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  Test a(n);
  a.run();
  return 0;
}
