#include <bits/stdc++.h>
using namespace std;
int a[400005];
int b[400005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    int mod = 1 << (i + 1);
    for (int i = 0; i < n; i++) {
      b[i] = a[i] % mod;
    }
    sort(b, b + n);
    int flag = 0;
    for (int j = 0; j < n; j++) {
      int l1 = lower_bound(b, b + n, (1 << i) - b[j]) - b;
      int r1 = lower_bound(b, b + n, (1 << (i + 1)) - b[j]) - b;
      flag = flag + r1 - l1;
      int l2 = lower_bound(b, b + n, (1 << (i + 1)) + (1 << i) - b[j]) - b;
      int r2 = lower_bound(b, b + n, (1 << (i + 2)) - b[j]) - b;
      flag = flag + r2 - l2;
      if ((b[j] + b[j]) & (1 << i)) {
        flag--;
      }
    }
    if (flag / 2 & 1) {
      ans = ans + (1 << i);
    }
  }
  cout << ans << endl;
}
