#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int n;
int a[N];
int v[N], m;
long long Count(int mod, int lim) {
  m = 0;
  for (int i = 0; i < n; ++i) v[m++] = a[i] % mod;
  sort(v, v + m);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int p = lower_bound(v, v + m, lim - (a[i] % mod)) - v;
    int q = lower_bound(v, v + m, mod - (a[i] % mod)) - v;
    ans += q - p;
    p = lower_bound(v, v + m, lim + mod - (a[i] % mod)) - v;
    ans += m - p;
    if ((a[i] + a[i]) % mod >= lim) ans--;
  }
  return ans / 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  int ans = 0;
  for (int k = 24; ~k; --k) {
    long long x = Count(1 << (k + 1), 1 << k);
    if (x & 1) ans |= 1 << k;
  }
  printf("%d\n", ans);
  return 0;
}
