#include <bits/stdc++.h>
using namespace std;
long long b[100] = {0}, b1[100] = {0};
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a, co = 1;
    cin >> a;
    bitset<61> bs(a);
    cout << bs << endl;
    for (int j = 0; j < 61; j++) {
      if (bs[j]) {
        b1[j]++;
      } else {
        b[j]++;
      }
    }
  }
  long long ans = 0, two = 1;
  for (int k = 0; k < 61; k++) {
    cout << b[k] << " " << b1[k] << endl;
    for (int l = 0; l < k; l++) {
      two = two * 2 % 1000000007;
    }
    ans += b[k] * b1[k] * two % 1000000007;
    two = 1;
    ans = ans % 1000000007;
  }
  cout << ans % 1000000007 << endl;
}
