#include<bits/stdc++.h>
#define file "homework"
using namespace std;
#define int long long
#define ld long double
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
const int N=1e6+5;
const int NN=1e3+9;
const int MOD=1e9+7;
const int dx[4]={0, -1, 0, 1};
const int dy[4]={-1, 0, 1, 0};
const int INF=1e18;
const ld eps=1e-6;
const ld pi=acos(-1.0); // 48 digits
int l, r, inv;
int Pow(int a, int b) {
if (b==0) return 1;
if (b==1) return a;
int tmp=Pow(a,b/2)%MOD;
if (b&1) return (((tmp*tmp)%MOD)*a)%MOD;
return (tmp*tmp)%MOD;
}
int Sum_range(int n) {
n%=MOD;
int res=(((n*(n+1))%MOD)*inv)%MOD;
return res;
}
int Sum(int n) {
int res=0;
int l=1;
int r=1;
while (l<=n) {
int same=n/l;
r=n/same;
int tmp1=((Sum_range(r)-Sum_range(l-1))%MOD+MOD)%MOD;
int tmp2=(same*tmp1)%MOD;
res=(res+tmp2)%MOD;
l=r+1;
}
return res;
}
void process() {
// Code here :V
cin>>l>>r;
inv=Pow(2,MOD-2);
cout<<((Sum(r)-Sum(l-1))%MOD+MOD)%MOD;
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
// freopen(file".inp","r",stdin);
// freopen(file".out","w",stdout);
int t=1;
// cin>>t;
while (t--) process();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBmaWxlICJob21ld29yayIKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGludCBsb25nIGxvbmcKI2RlZmluZSBsZCBsb25nIGRvdWJsZQojZGVmaW5lIHBpaSBwYWlyPGludCxpbnQ+CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgWCBmaXJzdAojZGVmaW5lIFkgc2Vjb25kCiNkZWZpbmUgbGIgbG93ZXJfYm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