#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int ub(int x, int j) {
  int l = j, r = v.size() - 1, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (v[mid] <= x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return l;
}
int lb(int x, int j) {
  int l = j, r = v.size() - 1, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (v[mid] < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long int gcd, i, h, l, r, j, k, x, y, z, x1, y1, x2, y2, n, m, root, t,
      sum, size, ind, ans1 = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  v.resize(n);
  long long int ans = 0;
  int po[28];
  po[0] = 1;
  for (i = 1; i < 28; i++) po[i] = po[i - 1] * 2;
  for (i = 0; i < 28 - 2; i++) {
    for (j = 0; j < n; j++) v[j] = (a[j] % po[i + 1]);
    sort(v.begin(), v.end());
    sum = 0;
    for (j = 0; j < n; j++) {
      sum += (ub(po[i + 1] - 1 - v[j], j + 1) - lb(po[i] - v[j], j + 1));
      sum += (ub(po[i + 2] - 2 - v[j], j + 1) -
              lb(po[i + 1] + po[i] - v[j], j + 1));
    }
    if (sum & 1) ans += po[i];
  }
  cout << ans;
  return 0;
}
