#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x;
  if (scanf("%lld", &x) == -1) exit(0);
  return x;
}
const int N = 400010;
int a[N], b[N];
signed main() {
  int n = read();
  for (int i = (0), _ = (n); i < _; i++) a[i] = read();
  int ans = 0;
  for (int i = (0), _ = (26); i < _; i++) {
    int mod = 1 << (i + 1);
    for (int j = (0), _ = (n); j < _; j++) b[j] = a[j] % mod;
    int s = 0;
    sort(b, b + n);
    for (int j = (0), _ = (n); j < _; j++) {
      int l, r;
      l = lower_bound(b, b + n, (1 << i) - b[j]) - b;
      r = lower_bound(b, b + n, (1 << (i + 1)) - b[j]) - b - 1;
      s += (r - l + 1);
      l = lower_bound(b, b + n, (1 << i) + (1 << (i + 1)) - b[j]) - b;
      r = lower_bound(b, b + n, (1 << (i + 2)) - b[j]) - b - 1;
      s += (r - l + 1);
      if ((b[j] + b[j]) & (1 << i)) s--;
    }
    if ((s / 2) & 1) ans += 1 << i;
  }
  cout << ans << endl;
  return 0;
}
