#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 4e5 + 5, LG = 24, A = 1 << LG;
int n, a[N], sum[2][A];
int get(int x, int l, int r) {
  if (l > r) return 0;
  if (l == 0)
    return sum[x][r];
  else
    return sum[x][r] - sum[x][l - 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int ans = 0;
  for (int mod = 1, bit = 0; mod <= A; mod <<= 1, bit += 1) {
    for (int i = 0; i < mod; ++i) {
      sum[0][i] = 0;
      sum[1][i] = 0;
    }
    for (int i = 1; i <= n; ++i) {
      ++sum[(a[i] / mod) & 1][a[i] % mod];
    }
    for (int i = 1; i < mod; ++i) {
      sum[0][i] += sum[0][i - 1];
      sum[1][i] += sum[1][i - 1];
    }
    ll cnt = 0;
    for (int i = 0; i < mod; ++i) {
      (cnt += 1LL * get(0, i, i) * get(0, max(i + 1, mod - i), mod - 1)) %= 2;
      if (i >= mod - i) {
        int tmp = get(0, i, i);
        (cnt += 1LL * tmp * (tmp - 1) / 2) %= 2;
      }
      (cnt += 1LL * get(1, i, i) * get(1, max(i + 1, mod - i), mod - 1)) %= 2;
      if (i >= mod - i) {
        int tmp = get(1, i, i);
        (cnt += 1LL * tmp * (tmp - 1) / 2) %= 2;
      }
      (cnt += 1LL * get(0, i, i) * get(1, 0, mod - i - 1)) %= 2;
    }
    if (cnt & 1) ans += 1 << bit;
  }
  cout << ans;
  return 0;
}
