#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
    ll N; cin>>N;
    ll arr[N];
    for(int i=0;i<N;i++)
        cin>>arr[i];
    ll ans = 0;
    int odd=0,even=0;
    for(int i=0;i<60;i++)
    {
        odd = 0;
        even = 0;
        ll 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)%mod*(odd%mod)*(even%mod))%mod;
    }
    cout<<ans<<"\n";

    return 0;
}