#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  long long x;
  cin >> x;
  return x;
}
const long long MOD = 1000000007;
void solve() {
  long long n = in(), m = 0;
  vector<long long> a(n);
  for (long long i = (0); i < (n); ++i) a[i] = in();
  for (long long i = (0); i < (60); ++i) {
    long long odd = 0, even = 0;
    for (long long j = (0); j < (n); ++j) (((a[j] >> i) & 1) ? odd : even)++;
    long long k = (long long)1 << i;
    k %= MOD;
    k *= (odd * even) % MOD;
    m += k;
    m %= MOD;
  }
  cout << m << endl;
}
int main() {}
