#include <bits/stdc++.h>
using namespace std;
const int N = 400000 + 5;
int a[N], b[N], n;
int pf[N], c[N], d[N], x[N], Pw[N];
void prework() {
  Pw[0] = 1;
  x[0] = 1;
  for (int i = 1; i <= 26; ++i) x[i] = x[i - 1] * 2 + 1, Pw[i] = Pw[i - 1] * 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  prework();
  long long ans = 0;
  for (int k = 0; k <= 24; ++k) {
    for (int i = 1; i <= n; ++i) c[i] = (x[k] & a[i]);
    sort(c + 1, c + n + 1);
    int l = n, r = n;
    int l1 = n, r1 = n, cnt = 0;
    long long num = 0;
    for (int i = 1; i <= n; ++i) {
      while (l >= 1 && c[l] + c[i] >= Pw[k]) --l;
      while (r >= 1 && c[r] + c[i] >= Pw[k + 1]) --r;
      while (l1 >= 1 && c[l1] + c[i] >= Pw[k] + Pw[k + 1]) --l1;
      while (r1 >= 1 && c[r1] + c[i] >= Pw[k + 2]) --r1;
      num += r - l;
      if ((a[i] * 2) & (1 << k)) ++cnt;
      if (r1 >= 1) num += r1 - l1;
    }
    num -= cnt;
    num /= 2;
    if (num % 2) ans += Pw[k];
  }
  cout << ans << endl;
  return 0;
}
