#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int n, a[N], b[N], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= 25; i++) {
    int mod = 1 << (i + 1);
    for (int j = 1; j <= n; j++) b[j] = a[j] % mod;
    sort(b + 1, b + 1 + n);
    int cnt = 0;
    for (int k = 1; k <= n; k++) {
      int l = lower_bound(b + 1, b + 1 + n, (1 << i) - b[k]) - b;
      int r = lower_bound(b + 1, b + 1 + n, (1 << (i + 1)) - b[k]) - b - 1;
      cnt += r - l + 1;
      l = lower_bound(b + 1, b + 1 + n, (1 << (i + 1)) + (1 << i) - b[k]) - b;
      r = lower_bound(b + 1, b + 1 + n, (1 << (i + 2)) - b[k]) - b - 1;
      cnt += r - l + 1;
      if ((b[k] + b[k]) & (1 << i)) cnt--;
    }
    if ((cnt / 2) & 1) ans += 1 << i;
  }
  printf("%d\n", ans);
  return 0;
}
