#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m = 1000000007;
  cin >> n;
  unsigned long long a[n];
  unsigned long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      ans = (ans % m + ((a[i] % m) ^ (a[j] % m)) % m) % m;
    }
  }
  cout << ans % m << endl;
  return 0;
}
