#include <bits/stdc++.h>
using namespace std;
int n, arr[400005], mod;
signed main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", arr + i);
  int ans = 0;
  for (int i = 0; i <= 25; ++i) {
    mod = 1 << (i + 1);
    int two = 1 << i;
    vector<int> a(n);
    for (int j = 0; j < n; ++j) a[j] = arr[j] % mod;
    sort(a.begin(), a.end());
    int odd = 0;
    for (int j = 0; j < n - 1; ++j) {
      int use = a[j];
      int l1 = lower_bound(a.begin() + j + 1, a.end(), two - use) - a.begin();
      if (l1 < n && a[l1] + use <= mod - 1) {
        int h1 =
            upper_bound(a.begin() + j + 1, a.end(), mod - 1 - use) - a.begin();
        if (h1 > n - 1 || a[h1] + use > mod - 1) --h1;
        odd += (h1 - l1 + 1);
      }
      int l2 =
          lower_bound(a.begin() + j + 1, a.end(), two + mod - use) - a.begin();
      odd += (n - l2);
    }
    if (odd & 1) ans |= two;
  }
  printf("%d", ans);
  return 0;
}
