#include <bits/stdc++.h>
using namespace std;
long long i[300010];
long long one[100];
long long zi[100];
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, c = 0, e = 0;
  cin >> a;
  long long d = 0;
  for (int n = 0; n < a; n++) {
    cin >> i[n];
    i[n] = i[n] % 1000000007;
    b = i[n];
    for (int m = 0; m <= 61; m++) {
      if (b % 2 == 0)
        zi[m]++;
      else
        one[m]++;
      b = b / 2;
    }
  }
  long long ans = 1;
  for (int n = 0; n <= 61; n++) {
    long long o = (ans) % 1000000007;
    o *= (one[n] % 1000000007) * (zi[n] % 1000000007);
    ans = ans * 2;
    o = o % 1000000007;
    d += o;
    d = d % 1000000007;
  }
  cout << d << '\n';
  return 0;
}
