#include <bits/stdc++.h>
using namespace std;
const long long N = 4e5 + 50;
long long a[N];
long long n;
long long pref[N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (long long i = 0; i <= 24; i++) {
    vector<long long> prefZero;
    vector<long long> prefOne;
    for (long long j = 0; j < n; j++) {
      if (a[j] & (1 << i)) {
        prefOne.push_back(pref[j]);
      } else {
        prefZero.push_back(pref[j]);
      }
    }
    sort(prefOne.begin(), prefOne.end());
    sort(prefZero.begin(), prefZero.end());
    long long cnt = 0;
    for (long long j = 0; j < n; j++) {
      if (a[j] & (1 << i)) {
        long long val = (1ll << i) - pref[j];
        cnt += prefOne.end() - lower_bound(prefOne.begin(), prefOne.end(), val);
        if (val <= pref[j]) {
          cnt--;
        }
        cnt += lower_bound(prefZero.begin(), prefZero.end(), val) -
               prefZero.begin();
      } else {
        long long val = (1ll << i) - pref[j];
        cnt +=
            prefZero.end() - lower_bound(prefZero.begin(), prefZero.end(), val);
        if (val <= pref[j]) {
          cnt--;
        }
        cnt +=
            lower_bound(prefOne.begin(), prefOne.end(), val) - prefOne.begin();
      }
      pref[j] |= a[j] & (1 << i);
    }
    cnt /= 2;
    if (cnt % 2 != 0) {
      ans |= (1 << i);
    }
  }
  cout << ans << '\n';
}
