#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 5;
int n, a[maxn], b[maxn], ans;
int get(int mi, int mx) {
  int ret = 0;
  for (int j = 1; j < n; j++) {
    int l = j + 1, r = n, mid;
    while (l <= r) {
      mid = l + r >> 1;
      if (b[j] + b[mid] >= mi)
        r = mid - 1;
      else
        l = mid + 1;
    }
    int t1 = l;
    l = j + 1, r = n;
    while (l <= r) {
      mid = l + r >> 1;
      if (b[j] + b[mid] <= mx)
        l = mid + 1;
      else
        r = mid - 1;
    }
    int t2 = r;
    if (b[j] + b[t1] < mi) continue;
    if (b[j] + b[t1] > mx) continue;
    if (b[j] + b[t2] < mi) continue;
    if (b[j] + b[t2] > mx) continue;
    if (t1 <= j || t1 > n) continue;
    if (t2 <= j || t2 > n) continue;
    ret += t2 - t1 + 1;
  }
  return ret;
}
signed main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 0; i < 28; i++) {
    int bit = 1 << i + 1, mi, mx;
    for (int j = 1; j <= n; j++) b[j] = a[j] % bit;
    sort(b + 1, b + 1 + n);
    mi = 1 << i;
    mx = (1 << i + 1) - 1;
    long long num = 0;
    num += get(mi, mx);
    mi = (1 << (i + 1)) + (1 << i);
    mx = (1 << i + 2) - 1;
    num += get(mi, mx);
    if (num & 1) ans |= 1 << i;
  }
  printf("%d\n", ans);
}
