#include <bits/stdc++.h>
using namespace std;
long double eps = (long double)1 / 1e15;
long long inf = 1e18, mod2 = 998244353, mod1 = 1e9 + 7;
long long sqr(long long a) { return a * a; }
long long qb(long long a) { return a * a * a; }
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
long long binpow(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod
                    : sqr(binpow(a, b / 2, mod)) % mod)
           : 1;
}
int a[400001], b[400001];
bitset<26> ans;
int main() {
  cout.tie(0), cin.tie(0), ios_base::sync_with_stdio(0);
  int n, i, j, t, lm, it, l, r, md;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 0; i <= 25; i++) {
    t = (1 << (i + 1));
    lm = (1 << i);
    for (j = 1; j <= n; j++) b[j] = a[j] % t;
    sort(b + 1, b + n + 1);
    for (j = 2, it = 0; j <= n; j++) {
      l = 1, r = j - 1;
      if (b[j] < lm) {
        while (r > l) {
          md = (r + l) / 2;
          if (b[md] + b[j] >= lm)
            r = md;
          else
            l = md + 1;
        }
        if (b[l] <= b[j] && b[l] + b[j] >= lm) it += (j - l) % 2, it %= 2;
      } else {
        while (r > l) {
          md = (r + l) / 2 + 1;
          if (b[md] + b[j] < t)
            l = md;
          else
            r = md - 1;
        }
        if (b[l] <= b[j] && b[l] + b[j] < t) it += l % 2, it %= 2;
        l = 1, r = j - 1;
        while (r > l) {
          md = (r + l) / 2;
          if (b[md] + b[j] >= lm + t)
            r = md;
          else
            l = md + 1;
        }
        if (b[l] <= b[j] && b[l] + b[j] >= lm + t) it += (j - l) % 2, it %= 2;
      }
    }
    ans[i] = it;
  }
  cout << ans.to_ulong();
  return 0;
}
