#include using namespace std; typedef long long ll; const ll mod = 1e9+7; int main(){ int n;cin>>n; ll sum=0; for(int i=0;i>x>>y; x++;x/=2; x%=mod;y%=mod; sum += x * y; sum %= mod; } cout << sum <