#include <bits/stdc++.h>
using namespace std;
long long int countpair(long long int arr[], long long int size,
                        long long int a, long long int b) {
  long long int cnt = 0;
  long long int i = 0, low = size - 1, high = size - 1;
  while (i < high) {
    low = max(i, low);
    while (low > i && arr[i] + arr[low] >= a) --low;
    while (high > low && arr[i] + arr[high] > b) --high;
    cnt += (high - low);
    ++i;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long int ans = 0;
  for (int i = 1; i <= 25; ++i) {
    long long int b[n];
    for (long long int j = 0; j < n; ++j) {
      b[j] = a[j] % (long long int)pow(2, i);
    }
    sort(b, b + n);
    long long int temp =
        countpair(b, n, (long long int)pow(2, i - 1),
                  (long long int)pow(2, i) - 1) +
        countpair(b, n, (long long int)pow(2, i) + (long long int)pow(2, i - 1),
                  (long long int)pow(2, i + 1) - 2);
    if (temp % 2 == 1) {
      ans += (long long int)pow(2, i - 1);
    }
  }
  cout << ans << '\n';
}
