#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  long long mod = pow(10, 9) + 7;
  map<int, long long> A;
  long long sum = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    for (int j = 0; j < i; j++) {
      for (int k = 0; k <= 60; k++) {
        if (((A[i] >> k) & 1) ^ (A[j] >> k) & 1) sum += (1 << k) % mod;
      }
      sum %= mod;
    }
    sum %= mod;
  }
  sum %= mod;
  cout << sum << endl;
  return 0;
}
