#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int i, j;
  long long keta = 1;
  long long ans = 0;
  long long one = 0;
  long long zero = 0;
  for (int j = 0; j < 70; j++) {
    for (int i = 0; i < n; i++) {
      if (a[i] % 2 == 0) {
        zero++;
      } else {
        one++;
      }
      a[i] = a[i] / 2;
    }
    ans += zero * one * keta % MOD;
    ans = ans % MOD;
    keta = (keta * 2) % MOD;
    one = 0;
    zero = 0;
  }
  cout << ans << endl;
}
