#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long long N = (long long)1e6 + 2829;
const long long INF = (long long)1e18 + 123133;
const double eps = (double)1e-9;
long long n, a[N], k, b[N], zero = 0;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  long long res = 0;
  for (long long k = 0; k <= 25; ++k) {
    long long ans = 0, posL, posR;
    for (long long i = 1; i <= n; ++i) b[i] = a[i] & ((1 << (k + 1)) - 1);
    sort(b + 1, b + 1 + n);
    for (long long i = 1; i <= n; ++i) {
      long long x = b[i];
      posL = lower_bound(b + 1, b + 1 + n, (1 << k) - x) - b;
      posR = upper_bound(b + 1, b + 1 + n, (1 << (k + 1)) - 1 - x) - b - 1;
      ans += max(zero, posR - posL + 1);
      posL = lower_bound(b + 1, b + 1 + n, (1 << k) + (1 << (k + 1)) - x) - b;
      posR = upper_bound(b + 1, b + 1 + n, (1 << (k + 2)) - 2 - x) - b - 1;
      ans += max(zero, posR - posL + 1);
      if (((1 << k) + (1 << (k + 1)) <= x + x && x + x <= (1 << (k + 2)) - 2) ||
          ((1 << k) <= x + x && x + x <= (1 << (k + 1)) - 1))
        ans--;
    }
    ans /= 2;
    if (ans % 2 == 1) res += (1 << k);
  }
  cout << res;
  return 0;
}
