#include <cmath>
#include <iostream>
//after
typedef long long ll;
const ll P = 1000000007;
ll n, prime[ll(1e5)], top;
bool notPrime[ll(1e5)];
int main(){
std::cin >> n;
ll limit = std::min(ll(sqrt(n) + 10), n);
ll ans = 1, rec = 0;
for(int i = 2 ; i <= limit ; ++i){
if(!notPrime[i])
prime[++top] = i;
for(int j = 1 ; prime[j] * i <= limit && j <= top; ++j){
notPrime[prime[j] * i] = true;
}
}
for(int i = 1 ; prime[i] <= n && i <= top; ++i ){
ll temp = prime[i];
while(temp * prime[i] <= n)
temp *= prime[i];
ans = (ans * (temp % P)) % P;
}
std::cout << ans;
return 0;
}