#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  long long a[n];
  int i, j;
  long long sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    scanf("%lld", &a[i]);
    sum += a[i];
  }
  for (int i = 0; i < (int)(n); i++) {
    sum = (sum ^ a[i]) / 1000000007;
    sum = sum / 1000000007;
  }
  printf("%lld", sum);
}
