#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  int b0[65];
  int b1[65];
  for (int j = 0; j < 65; j++) b0[j] = 0;
  for (int j = 0; j < 65; j++) b1[j] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 65; j++) {
      if (a[i] % 2 == 0)
        b0[j]++;
      else
        b1[j]++;
      a[i] = a[i] / 2;
    }
  }
  for (int j = 0; j < 65; j++) {
    long long bit_ans = 1;
    bit_ans *= b0[j] * b1[j] % 1000000007;
    for (int i = 0; i < j; i++) bit_ans *= 2 % 1000000007;
    ans += bit_ans % 1000000007;
  }
  cout << ans % 1000000007;
  return 0;
}
