#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 9;
const long long mod = 998244353;
int a[N], b[N];
int main() {
  int n;
  int ans = 0;
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i]);
  for (int op = 1; op < 2e7; op <<= 1) {
    for (int i = (0); i < (n); ++i) b[i] = a[i] & (op - 1);
    int sum = 0;
    for (int i = (0); i < (n); ++i) sum += (a[i] & op) != 0;
    if ((sum & 1) && ((n - 1) & 1)) ans ^= op;
    sum = 0;
    sort(b, b + n);
    int p = n - 1;
    for (int i = (0); i < (n); ++i) {
      p = max(i, p);
      for (; p > i && b[p] + b[i] >= op; --p)
        ;
      sum ^= (n - 1 - p);
    }
    if (sum & 1) ans ^= op;
  }
  cout << ans;
}
