#include<bits/stdc++.h>
#define FOR(i,a,b,k) for (ll i=a;i<=b;i+=k)
#define FORD(i,a,b,k) for (ll i=a;i>=b;i-=k)
#define pb(i) push_back(i)
#define ll long long int
#define MOD 1000000007
#define lim 1e16
#define F first
#define S second
using namespace std;
ll l,r;
vector<ll> p;
vector<bool> a(1e7,0);
unordered_map<ll,ll> m,v;
void sieve()
{
p.pb(2);
FOR(i,3,1e7,2)
{
if(a[i]==0)
{
p.pb(i);
FOR(j,i*3,1e7,i*2) a[j]=1;
}
}
}
void loading()
{
FOR(i,l,r,1)
{
m[i]=i;
}
for(auto i:p)
{
FOR(j,(l+i-1)/i*i,r,i)
{
ll c=0;
while(m[j]%i==0)
{
m[j]/=i;
c++;
}
v[i]=max(v[i],c);
}
}
ll res=1;
for(auto x:v)
{
ll k=pow(x.F,x.S);
res=((res%MOD)*(k%MOD))%MOD;
}
for(auto x:m) res=((res%MOD)*(x.S%MOD))%MOD;
cout<<res;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
cin>>l>>r;
sieve();
loading();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBGT1IoaSxhLGIsaykgZm9yIChsbCBpPWE7aTw9YjtpKz1rKQojZGVmaW5lIEZPUkQoaSxhLGIsaykgZm9yIChsbCBpPWE7aT49YjtpLT1rKQojZGVmaW5lIHBiKGkpIHB1c2hfYmFjayhpKQojZGVmaW5lIGxsIGxvbmcgbG9uZyBpbnQKI2RlZmluZSBNT0QgMTAwMDAwMDAwNwojZGVmaW5lIGxpbSAxZTE2CiNkZWZpbmUgRiBmaXJzdAojZGVmaW5lIFMgc2Vjb25kCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmxsIGwscjsKCnZlY3RvcjxsbD4gcDsKdmVjdG9yPGJvb2w+IGEoMWU3LDApOwoKdW5vcmRlcmVkX21hcDxsbCxsbD4gbSx2OwoKdm9pZCBzaWV2ZSgpCnsKCXAucGIoMik7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