#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long ans = 0;
  for (long long i = 0; i <= 26; i++) {
    vector<long long> temp;
    temp.clear();
    for (long long val : v) {
      long long mod_val = val % (1 << (i + 1));
      temp.push_back(mod_val);
    }
    long long cnt = 0;
    sort(temp.begin(), temp.end());
    for (long long j = 0; j < n; j++) {
      long long l =
          lower_bound(temp.begin() + j + 1, temp.end(), (1 << i) - temp[j]) -
          temp.begin();
      long long r = lower_bound(temp.begin() + j + 1, temp.end(),
                                (1 << (i + 1)) - temp[j]) -
                    temp.begin();
      cnt += (r - l);
      l = lower_bound(temp.begin() + j + 1, temp.end(),
                      (1 << i) + (1 << (i + 1)) - temp[j]) -
          temp.begin();
      cnt += (n - l);
    }
    if (cnt % 2 == 1) ans = ans + (1 << i);
  }
  cout << ans << "\n";
}
