#include <bits/stdc++.h>

#define el '\n'
#define fi first
#define sec second
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define sz(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define REP(i, a, b) for(int i = (b), _a = (a); i >= _a; i--)

using namespace std;

const int MOD = 1e9 + 7;
const int inv2 = (MOD + 1) / 2;

inline int cong(ll x, ll y){
    ll z = x + y;
    while(z >= MOD) z -= MOD;
    return z;
}

inline int nhan(ll x, ll y){
    return (x * y) % MOD;
}

int tinh_tong(ll l, ll r){
    ll one = (r - l + 1 + MOD) % MOD;
    ll two = cong(l, r);
    return nhan(nhan(one, two), inv2);
}

ll tinh(ll n){
    ll first_pos = 1, res = 0;

    while(first_pos <= n){
        ll val = n / first_pos, last_pos;

        if(!val) last_pos = n;
        else last_pos = n / val;

        res = cong(res, nhan(tinh_tong(first_pos, last_pos), val));

        first_pos = last_pos + 1;
    }

    return res;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    ll l, r;
    cin >> l >> r;

    cout << (tinh(r) - tinh(l - 1)) + MOD % MOD;
}
