#include <cmath>
#include <iostream>
//after
typedef long long ll;
const ll P = 1000000007;
ll n, prime[ll(1e8) + 10], top;
bool notPrime[ll(1e8) + 10];
int main(){
std::cin >> n;
ll limit = n;
ll ans = 1;
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;
}