#include <bits/stdc++.h>
using namespace std;
using ul = unsigned long;
using ll = long long;
ll mod = 1000000007;
ll f(ll a, ll b) {
  cerr << "a: " << a << " b: " << b << endl;
  cerr << "a ^ b: " << (a ^ b) << endl;
  return a ^ b;
}
int main() {
  int N;
  cin >> N;
  vector<ll> A;
  ll a;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    A.push_back(a);
  }
  ll r = 0;
  for (int i = 0; i < N - 1; ++i) {
    for (int j = i + 1; j < N; ++j) {
      r += f(A[i], A[j]);
      r %= mod;
    }
  }
  cout << r << endl;
}
