#include <bits/stdc++.h>
using namespace std;
int modpow(int a, int b, int mod) {
  int x = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) x = (long long)x * a % mod;
    a = (long long)a * a % mod;
  }
  return x;
}
int main() {
  int N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  int mod = 1e9 + 7;
  int ans = 0;
  for (int i = 0; i < (N - 1); ++i)
    for (int j = i + 1; j < N; j++) {
      bitset<60> a(A[i]), b(A[j]);
      auto c = a ^ b;
      for (int i = 0; i < (60); ++i) {
        if (c[i] == 0)
          continue;
        else {
          ans += modpow(2, i, mod);
          ans %= mod;
        }
      }
    }
  cout << ans << endl;
  return 0;
}
