#include <bits/stdc++.h>
using namespace std;
const int dr[]{-1, -1, 0, 1, 1, 1, 0, -1};
const int dc[]{0, 1, 1, 1, 0, -1, -1, -1};
void run() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
struct fenwickTree {
  vector<int> BIT;
  int n;
  fenwickTree(int n) : n(n) { BIT = vector<int>(n + 1); }
  int getAccum(int idx) {
    int sum = 0;
    while (idx) {
      sum += BIT[idx];
      idx -= (idx & -idx);
    }
    return sum;
  }
  void add(int idx, int val) {
    while (idx <= n) {
      BIT[idx] += val;
      idx += (idx & -idx);
    }
  }
  int getValue(int r, int l) {
    r = min(r, n);
    if (l > r) return 0;
    if (r < 1) return 0;
    int rt = getAccum(r);
    if (l - 1 > 0) rt -= getAccum(l - 1);
    return rt;
  }
};
vector<int> v;
int solve(int bit) {
  int mn = (1 << bit), mx = (1 << bit + 1) - 1;
  fenwickTree BIT(mx);
  long long ans = 0;
  int cnt0 = 0;
  for (int i = (int)(v.size()) - 1; i >= 0; i--) {
    int val = v[i] & mx;
    int cnt = BIT.getValue(mx - val, mn - val);
    cnt += BIT.getValue(mx - val + mx + 1, mn - val + mx + 1);
    if (mn <= val) cnt += cnt0;
    if (val) {
      BIT.add(val, 1);
    } else
      cnt0++;
    ans = (ans + cnt & 1);
  }
  return ans;
}
int main() {
  run();
  int n;
  cin >> n;
  v = vector<int>(n);
  for (auto &it : v) cin >> it;
  long long ans = 0;
  for (int i = 0; i < 25; i++)
    if (solve(i)) ans |= (1 << i);
  cout << ans;
}
