#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<long double, long double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int MOD = 1000000007;
template <typename AT>
void printvec(vector<AT> &ar) {
  for (int i = 0; i < (ar.size() - 1); ++i) cout << ar[i] << " ";
  cout << ar[ar.size() - 1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar) {
  for (int i = 0; i < (ar.size()); ++i) {
    for (int j = 0; j < (ar[0].size() - 1); ++j) cout << ar[i][j] << " ";
    cout << ar[i][ar[0].size() - 1] << endl;
  }
}
template <typename S>
bool range(S a, S b, S x) {
  return (a <= x && x < b);
}
int main() {
  int n;
  cin >> n;
  vector<ll> ar(n);
  for (int i = 0; i < (n); ++i) cin >> ar[i];
  int ans = 0;
  for (int i = 0; i < (n - 1); ++i) {
    for (int j = i + 1; j < (n); ++j) {
      ll k = (ar[i] ^ ar[j]) % MOD;
      ans += k;
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
