#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
#include<string>
#include<map>
#include<cstring>
#include<vector>
#define inf 1e9
#define ll long long
#define For(i,j,k) for(int i=j;i<=k;i++)
#define Dow(i,j,k) for(int i=k;i>=j;i--)
using namespace std;
int mo=1000000007;
int n,tot,pri[10000001];
ll ans;
bool bj[100000001];
inline void get_pri()
{
For(i,2,n)
{
if(!bj[i])
pri[++tot]=i;
For(j,1,tot)
{
if(i*pri[j]>n) break;
bj[i*pri[j]]=1;
if(i%pri[j]==0) break;
}
}
}
int main()
{
scanf("%d",&n);
get_pri();
ans=1;
For(i,1,tot)
{
int num=pri[i];
ll tmp=1;
while(tmp*num<=n) tmp*=num;
ans=((ll)ans*tmp)%(ll)mo;
}
printf("%d\n",ans);
}