#include <bits/stdc++.h>
const int N = 4e5 + 5;
int n, a[N], b[N], i, j, k, ans;
long long calc(int x) {
  long long tot = 0;
  for (j = 1, k = n; j <= n; ++j) {
    for (; k && b[k] + b[j] >= x; --k)
      ;
    tot += (n - k) - (k < j);
  }
  return tot / 2;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d", a + i);
  for (i = 0; i < 25; ++i) {
    for (j = 1; j <= n; ++j) b[j] = a[j] & ((1 << i + 1) - 1);
    std::sort(b + 1, b + n + 1);
    ans += ((calc(1 << i) - calc(2 << i) + calc(3 << i)) & 1) << i;
  }
  printf("%d\n", ans);
}
