#include <bits/stdc++.h>
using namespace std;
inline void read(long long &x) {
  char ch = getchar();
  x = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
}
const long long N = 4e5 + 10;
long long n, res, a[N], b[N];
inline long long get(long long x) {
  long long j = n, tmp = 0;
  for (long long i = 1; i <= n; ++i) {
    while (b[i] + b[j] >= x && j >= 1) --j;
    tmp += j - (j >= i);
  }
  return tmp >> 1;
}
signed main() {
  read(n);
  for (long long i = 1; i <= n; ++i) read(a[i]);
  for (long long i = 0; i <= 25; ++i) {
    long long x = 1 << i, y = x << 1;
    for (long long j = 1; j <= n; ++j) b[j] = a[j] % y;
    sort(b + 1, b + n + 1);
    long long tmp = get(y) - get(x) + get(y << 1) - get(x + y);
    res += x * (tmp & 1);
  }
  return printf("%lld\n", res), 0;
}
