#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vs = vector<string>;
using vvs = vector<vs>;
using pli = pair<long long, int>;
using vpli = vector<pli>;
int main() {
  ll N, ans = 0;
  ll inv = pow(10, 9) + 7;
  cin >> N;
  vector<ll> As(N);
  for (ll i = 0; i < N; i++) {
    cin >> As.at(i);
  }
  for (ll i = 0; i < N - 1; i++) {
    for (ll j = i + 1; j < N; j++) {
      ans += As.at(i) ^ As.at(j);
      ans %= inv;
    }
  }
  cout << ans << endl;
}
