#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long ZERO = 0;
const long long INF = MOD * MOD;
const long double EPS = 1e-9;
const long double PI = 3.14159265358979323846;
long long gcd(long long m, long long n) {
  long long a = max(m, n);
  long long b = min(m, n);
  while (b != 1 && b != 0) {
    a %= b;
    swap(a, b);
  }
  return b == 1 ? 1 : a;
}
long long lcm(long long m, long long n) { return m / gcd(m, n) * n; }
long long power_mod(long long a, long long power, long long mod) {
  long long value = 1;
  while (power != 0) {
    if (power & 1) value = (value * a) % mod;
    a = (a * a) % mod;
    power = power >> 1;
  }
  return value % mod;
}
long long modinv(long long a, long long mod) {
  return power_mod(a, mod - 2, mod);
}
long long power_normal(long long a, long long power) {
  long long value = 1;
  while (power != 0) {
    if (power & 1) value = value * a;
    a = a * a;
    power = power >> 1;
  }
  return value;
}
long long combination(long long n, long long r) {
  long long numerator = 1;
  long long denomenator = 1;
  for (long long i = 0; i < r; i++) {
    (numerator *= long long(n - i)) %= MOD;
    (denomenator *= modinv(i + 1, MOD)) %= MOD;
  }
  return (numerator * denomenator) % MOD;
}
long long bin_search(long long key, long long A[], long long left,
                     long long right) {
  while (right >= left) {
    long long mid = left + (right - left) / 2;
    if (A[mid] == key)
      return mid;
    else if (A[mid] > key)
      right = mid - 1;
    else if (A[mid] < key)
      left = mid + 1;
  }
  return -1;
}
long long lower_bound_bin_search(long long key, long long A[], long long left,
                                 long long right) {
  if (A[left] >= key) return left;
  long long mid = left + (right - left) / 2;
  while (right >= left) {
    mid = left + (right - left) / 2;
    if (mid == left) return -1;
    if (A[mid - 1] < key && key <= A[mid])
      return mid;
    else if (A[mid - 1] >= key)
      right = mid - 1;
    else if (A[mid] < key)
      left = mid;
  }
  return -1;
}
long long inf_bin_search(long long key, long long A[], long long left,
                         long long right) {
  if (A[left] > key) return left;
  long long mid = left + (right - left) / 2;
  while (right >= left) {
    mid = left + (right - left) / 2;
    if (mid == left) return -1;
    if (A[mid - 1] <= key && key < A[mid])
      return mid;
    else if (A[mid - 1] > key)
      right = mid - 1;
    else if (A[mid] <= key)
      left = mid;
  }
  return -1;
}
long long upper_bound_bin_search(long long key, long long A[], long long left,
                                 long long right) {
  if (A[right] <= key) return right;
  long long mid = left + (right - left) / 2;
  while (right >= left) {
    mid = left + (right - left) / 2;
    if (mid == right) return -1;
    if (A[mid] <= key && key < A[mid + 1])
      return mid;
    else if (A[mid] > key)
      right = mid;
    else if (A[mid + 1] <= key)
      left = mid + 1;
  }
  return -1;
}
long long sup_bin_search(long long key, long long A[], long long left,
                         long long right) {
  if (A[right] < key) return right;
  long long mid = left + (right - left) / 2;
  while (right >= left) {
    mid = left + (right - left) / 2;
    if (mid == right) return -1;
    if (A[mid] < key && key <= A[mid + 1])
      return mid;
    else if (A[mid] >= key)
      right = mid;
    else if (A[mid + 1] < key)
      left = mid + 1;
  }
  return -1;
}
long long fact(long long n) {
  if (n == 0) return 1;
  return n * fact(n - 1);
}
bool is_prime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long bool_sum(long long a1, long long a2) {
  if (a1 == 1 || a2 == 1) return 1;
  return 0;
}
std::map<long long, long long> prime_decomposition(long long n) {
  long long i = 2;
  std::map<long long, long long> table;
  while (i * i <= n) {
    while (n % i == 0) {
      table[i]++;
      n /= i;
    }
    i++;
  }
  if (n > 1) table[n] = 1;
  return table;
}
long long char_to_idx(char c) {
  long long idx = 0;
  for (char(cc) = ('a'); (cc) <= ('z'); (cc)++) {
    if (c == cc)
      return idx;
    else
      idx++;
  }
}
const long long MAX_N = 200005;
long long n;
long long a[MAX_N];
int main(void) {
  cin >> (n);
  for (long long((i)) = 0; ((i)) < ((n)); ((i))++) cin >> (a[(i)]);
  long long cnt[60][2];
  for (long long(d) = 0; (d) < (60); (d)++) {
    cnt[d][0] = 0;
    cnt[d][1] = 0;
    for (long long(i) = 0; (i) < (n); (i)++) {
      if (a[i] % 2 == 0)
        cnt[d][0]++;
      else
        cnt[d][1]++;
      a[i] /= 2;
    }
  }
  long long answer = 0;
  long long part1, part2;
  for (long long(i) = 0; (i) < (60); (i)++) {
    part1 = power_mod(2, i, MOD);
    part2 = (cnt[i][0] * cnt[i][1]) % MOD;
    answer += (part1 * part2) % MOD;
    answer %= MOD;
  }
  cout << (answer) << endl;
  return 0;
}
