#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 400010;
const int MAXT = (1 << 25) + 1;
const int INF = 2147483600;
int N;
int a[MAXN + 1];
int sum[MAXT + 1];
bool sm[MAXT + 1];
bool hv;
int main() {
  N = read();
  long long ans = 0;
  for (int i = 1; i <= N; i++) a[i] = read();
  long long ans1 = 0;
  for (int j = 0; j <= 24; j++) {
    int MAX = ((1 << (j + 1)) - 1);
    for (int i = 1; i <= N; i++) {
      int x = a[i];
      x = x & MAX;
      sum[x]++;
    }
    sm[0] = sum[0] & 1;
    for (int i = 1; i <= MAX; i++) sm[i] = sm[i - 1] ^ (sum[i] & 1);
    int hv1 = (1 << j), NW;
    if (j) NW = (3 << j);
    hv = 0;
    for (int i = 0; i <= MAX; i++) {
      if (!sum[i]) continue;
      int l = max(0, hv1 - i), r = min(MAX - i, i);
      if (r != i && l <= r) {
        hv ^= (sm[r] ^ (l > 0 ? sm[l - 1] : 0)) & (sum[i] & 1);
      } else if (l <= r && r == i) {
        hv ^=
            ((r > 0 ? sm[r - 1] : 0) ^ (l > 0 ? sm[l - 1] : 0)) & (sum[i] & 1);
        hv ^= ((sum[i] * (sum[i] - 1) / 2) & 1);
      }
      if (!j) {
        sum[i] = 0;
        continue;
      }
      l = NW - i, r = i;
      if (r != i && l <= r) {
        hv ^= (sm[r] ^ (l > 0 ? sm[l - 1] : 0)) & (sum[i] & 1);
      } else if (l <= r && r == i) {
        hv ^=
            ((r > 0 ? sm[r - 1] : 0) ^ (l > 0 ? sm[l - 1] : 0)) & (sum[i] & 1);
        hv ^= ((sum[i] * (sum[i] - 1) / 2) & 1);
      }
      sum[i] = 0;
    }
    ans += (hv << j);
  }
  cout << ans << endl;
  return 0;
}
