#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int c = 0;
  for (int j = n - 1; j >= 1; j--) {
    c *= j;
  }
  int answer = 0;
  int tmp;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      tmp = a[i] ^ a[j];
      cout << tmp << endl;
      answer += tmp;
    }
  }
  cout << answer % (1000000000 + 7) << endl;
}
