#include <bits/stdc++.h>
using namespace std;
const int maxn = 400010;
int n, arr[maxn], tmp[maxn], ans;
vector<int> v[2];
void radix(int ith);
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < 27; ++i) {
    radix(i);
    copy(arr, arr + n, tmp);
    for (int j = 0, k = (1 << i + 1) - 1; j < n; ++j) tmp[j] &= k;
    int L = n, R = n;
    long long cnt = 0;
    for (int j = 0; j < n; ++j) {
      L = max(j + 1, L);
      while (L > j + 1 && tmp[j] + tmp[L - 1] >= (1 << i)) --L;
      while (R > L && tmp[j] + tmp[R - 1] >= (1 << i + 1)) --R;
      if (R > L) cnt += R - L;
    }
    L = n, R = n;
    for (int j = 0; j < n; ++j) {
      L = max(j + 1, L);
      while (L > j + 1 && tmp[j] + tmp[L - 1] >= (1 << i) + (1 << i + 1)) --L;
      while (R > L && tmp[j] + tmp[R - 1] > (1 << i + 2) - 2) --R;
      if (R > L) cnt += R - L;
    }
    ans ^= (cnt & 1) << i;
  }
  cout << ans << endl;
  return 0;
}
void radix(int ith) {
  int i = 0;
  for (; i < n; ++i) {
    v[(arr[i] >> ith) & 1].push_back(arr[i]);
  }
  for (i = 0; i < v[0].size(); ++i) arr[i] = v[0][i];
  v[0].clear();
  for (int j = 0; j < v[1].size(); ++j, ++i) arr[i] = v[1][j];
  v[1].clear();
}
