#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n];
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    long long int b[n];
    long long int ans = 0;
    for (long long int k = 0; k < 27; k++) {
      long long int m = pow(2, k + 1);
      for (long long int i = 0; i < n; i++) b[i] = arr[i] % m;
      sort(b, b + n);
      long long int sum1 = pow(2, k), sum2 = pow(2, k + 1) + sum1;
      long long int co = 0;
      for (long long int i = 0; i < n; i++) {
        co -= (lower_bound(b + i + 1, b + n, sum1 - b[i]) - b);
        co += (lower_bound(b + i + 1, b + n, pow(2, k + 1) - b[i]) - b);
        co += n - (lower_bound(b + i + 1, b + n, sum2 - b[i]) - b);
      }
      if (co % 2 == 1) ans += (pow(2, k));
    }
    cout << ans << endl;
  }
  return 0;
}
