#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long arr[N];
  for (int i = 0; i < N; i++) cin >> arr[i];
  long long ans = 0;
  int odd = 0, even = 0;
  for (int i = 0; i < 60; i++) {
    odd = 0;
    even = 0;
    long long sum = 0;
    for (int j = 0; j < N; j++) {
      if (arr[j] % 2 == 0)
        odd++;
      else
        even++;
      arr[j] = arr[j] / 2;
    }
    ans = (ans +
           (1ll << i) % 1000000007 * (odd % 1000000007) * (even % 1000000007)) %
          1000000007;
  }
  cout << ans << "\n";
  return 0;
}
