#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &p : a) cin >> p;
  int LOG = 25, ans = 0;
  for (int pos = LOG - 1; pos + 1; --pos) {
    ans <<= 1;
    int cur = 1 << pos;
    int next = (1 << (pos + 1)) - 1;
    vector<int> aa(n);
    for (int i = 0; i < n; ++i) aa[i] = a[i] & next;
    sort(aa.begin(), aa.end());
    ++next;
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
      cnt += n - i - 1;
      int l =
          lower_bound(aa.begin() + i + 1, aa.end(), next - aa[i]) - aa.begin();
      int r = lower_bound(aa.begin() + i + 1, aa.end(), next + cur - aa[i]) -
              aa.begin() - 1;
      l = max(l, i + 1);
      cnt -= max(0, r - l + 1);
      l = i + 1;
      r = lower_bound(aa.begin() + i + 1, aa.end(), cur - aa[i]) - aa.begin() -
          1;
      cnt -= max(0, r - l + 1);
    }
    ans += cnt & 1;
  }
  cout << ans << '\n';
  return 0;
}
