#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(ll i=j;i<=k;i++)
#define Dow(i,j,k) for(ll 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 ksm(int x,int y)
{
int sum=1;for(;y;y>>=1){if(y&1)sum=sum*x;x=x*x;} return sum;
}
int main()
{
scanf("%d",&n);
get_pri();
ans=1;
For(i,1,tot)
{
int num=pri[i];
int t=log(n)/log(num);
ans=((ll)ans*ksm(num,t))%(ll)mo;
}
printf("%d\n",ans);
}