#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int INF = 1e9 + 7;
const int N = 2e5 + 7;
const int M = 1e6 + 7;
int a[M], b[M];
signed main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i <= 26; i++) {
    long long _ans = 0;
    int mod = 1 << (i + 1);
    for (int j = 1; j <= n; j++) b[j] = a[j] % mod;
    sort(b + 1, b + n + 1);
    for (int j = 1; j <= n; j++) {
      int l, r;
      l = lower_bound(b + 1, b + n + 1, (1 << i) - b[j]) - b;
      r = lower_bound(b + 1, b + n + 1, (1 << (i + 1)) - b[j]) - b - 1;
      _ans += (r - l + 1ll);
      l = lower_bound(b + 1, b + n + 1, (1 << i) + (1 << (i + 1)) - b[j]) - b;
      r = lower_bound(b + 1, b + n + 1, (1 << (i + 2)) - b[j]) - b - 1;
      _ans += (r - l + 1ll);
      if ((b[j] + b[j]) & (1 << i)) _ans--;
    }
    if ((_ans / 2) & 1) ans += (1 << i);
  }
  cout << ans << "\n";
  return 0;
}
