#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b = 0;
  ;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long c = pow(10, 9) + 7;
  for (int i = 1; i <= n; i++) {
    for (int g = i; g <= n; g++) {
      b += a[i] ^ a[g];
      b %= c;
    }
  }
  cout << b;
}
