#include <bits/stdc++.h>
using namespace std;
long long mi[200005], ma[200005], s[200005];
int add[200005], a[200005], adeb[200005];
int M = 300, n;
void upd(int i) {
  for (int j = i; j < min(n, i + M); ++j) {
    a[j] += add[i];
  }
  add[i] = 0;
  mi[i] = a[i];
  ma[i] = 0;
  s[i] = a[i];
  for (int j = i + 1; j < min(n, i + M); ++j) {
    if (j % 2) {
      s[i] -= a[j];
      ma[i] = max(ma[i], s[i]);
    } else {
      s[i] += a[j];
      mi[i] = min(mi[i], s[i]);
    }
  }
}
const int DEBUG = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    --a[i];
    adeb[i] = a[i];
  }
  int T;
  scanf("%d", &T);
  M = min(n, M);
  for (int i = 0; i < n; i += M) {
    upd(i);
  }
  for (int test = 1; test <= T; ++test) {
    int type, l, r, cadd;
    scanf("%d%d%d", &type, &l, &r);
    ++r;
    int l1 = (l + M - 1) / M * M;
    int r1 = r / M * M;
    if (type == 1) {
      scanf("%d", &cadd);
      if (DEBUG)
        for (int i = l; i < r; ++i) adeb[i] += cadd;
      for (int i = l; i < min(l1, r); ++i) a[i] += cadd;
      for (int i = max(l1, r1); i < r; ++i) a[i] += cadd;
      if (r1 < n) upd(r1);
      if (l1 > 0) upd(l1 - M);
      for (int x = l1; x < r1; x += M) add[x] += cadd;
    } else {
      if (r1 < n) upd(r1);
      if (l1 > 0) upd(l1 - M);
      long long sum = 0;
      int res = 1;
      for (int i = l; i < min(l1, r); ++i) {
        if ((i - l) % 2) {
          sum -= a[i];
          if (sum > 0) {
            res = 0;
            break;
          }
        } else {
          sum += a[i];
          if (sum < 0) {
            res = 0;
            break;
          }
        }
      }
      if (res)
        for (int i = l1; i < r1; i += M) {
          if (l % 2 == 0) {
            if (sum + mi[i] + add[i] < 0) {
              res = 0;
              break;
            }
            if (sum + ma[i] > 0) {
              res = 0;
              break;
            }
            sum += s[i];
          } else {
            if (sum - mi[i] - add[i] > 0) {
              res = 0;
              break;
            }
            if (sum - ma[i] < 0) {
              res = 0;
              break;
            }
            sum -= s[i];
          }
        }
      if (res)
        for (int i = max(l1, r1); i < r; ++i) {
          if ((i - l) % 2) {
            sum -= a[i];
            if (sum > 0) {
              res = 0;
              break;
            }
          } else {
            sum += a[i];
            if (sum < 0) {
              res = 0;
              break;
            }
          }
        }
      if (sum) res = 0;
      if (DEBUG) {
        int resdeb = 1;
        long long sum = 0;
        for (int i = l; i < r; ++i) {
          if ((i - l) % 2) {
            sum -= adeb[i];
            if (sum > 0) {
              resdeb = 0;
              break;
            }
          } else {
            sum += adeb[i];
            if (sum < 0) {
              resdeb = 0;
              break;
            }
          }
        }
        if (sum) resdeb = 0;
        printf("%d %d\n", res, resdeb);
        assert(res == resdeb);
      } else {
        printf("%d\n", res);
      }
    }
  }
  return 0;
}
