#include <bits/stdc++.h>
const double eps = (1e-9);
using namespace std;
int dcmp(long double a, long double b) {
  return fabsl(a - b) <= eps ? 0 : (a > b) ? 1 : -1;
}
int getBit(long long num, int idx) { return ((num >> idx) & 1ll) == 1; }
int setBit1(long long num, long long idx) { return num | (1ll << idx); }
long long setBit0(long long num, int idx) { return num & ~(1ll << idx); }
long long flipBit(long long num, int idx) { return num ^ (1ll << idx); }
void run() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int countNumBit1(int mask) {
  int ret = 0;
  while (mask) {
    mask &= (mask - 1);
    ++ret;
  }
  return ret;
}
vector<int> v[30];
long long arr[400000 + 9], res[30];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int P = 1;
    bitset<26> pp(arr[i]);
    for (int j = 0; j <= 25; j++) {
      if (pp[j] == 1) ans += P;
      P *= 2;
      v[j].push_back(ans);
    }
  }
  for (int j = 0; j <= 25; j++) sort(((v[j]).begin()), ((v[j]).end()));
  long long ans = 0;
  for (int j = 0; j <= 25; j++) {
    ans = 0;
    for (int i = 0; i < ((int)(v[j]).size()); i++) {
      int num = v[j][i];
      int a = 1, b = 0;
      if (num < (1 << j)) {
        a = (1 << j) - num;
        b = a + ((1 << (j + 1)) - 1) - (1 << j);
      } else if (num <= ((1 << (j + 1)) - 1)) {
        a = 0;
        b = ((1 << (j + 1)) - 1) - num;
      }
      int A = lower_bound(((v[j]).begin()), ((v[j]).end()), a) - v[j].begin();
      int B =
          upper_bound(((v[j]).begin()), ((v[j]).end()), b) - v[j].begin() - 1;
      if (A <= B && B >= 0 && A < ((int)(v[j]).size()) && a <= b &&
          v[j][A] <= b && v[j][B] >= a) {
        ans += B - A + 1;
        if (num >= a && num <= b) ans--;
      }
      if (num < (1 << j) + (1 << (j + 1))) {
        a = (1 << j) + (1 << (j + 1)) - num;
        b = a + (((1 << (j + 2)) - 2) - ((1 << j) + (1 << (j + 1))));
      } else if (num <= ((1 << (j + 2)) - 2)) {
        a = 0;
        b = ((1 << (j + 2)) - 2) - num;
      }
      A = lower_bound(((v[j]).begin()), ((v[j]).end()), a) - v[j].begin();
      B = upper_bound(((v[j]).begin()), ((v[j]).end()), b) - v[j].begin() - 1;
      if (A <= B && B >= 0 && A < ((int)(v[j]).size()) && a <= b &&
          v[j][A] <= b && v[j][B] >= a) {
        ans += B - A + 1;
        if (num >= a && num <= b) ans--;
      }
    }
    res[j] += ans / 2;
  }
  long long P = 1, fans = 0;
  for (int j = 0; j <= 25; j++) {
    if (res[j] % 2 != 0) fans += P;
    P *= 2;
  }
  cout << fans << "\n";
}
