#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  long long int mod = 1000000000 + 7;
  int m = n;
  while (m--) {
    int k;
    cin >> k;
    v.push_back(k);
  }
  int i = 0, j = 1;
  long long int sum = 0;
  for (i = 0; i <= v.size() - 2; i++) {
    for (j = i + 1; j <= v.size() - 1; j++) {
      sum = ((sum % mod) + (v[i] ^ v[j] % mod)) % mod;
    }
  }
  cout << sum << endl;
}
