#include<cstdio>
#include<iostream>
//#include"debug.h"
using namespace std;
const int maxl=20010;
int n,phi[maxl],p[maxl],cnt,i,j,k,ji;
long long ans=1;
int main()
{
freopen("msta.in","r",stdin);
freopen("msta.out","w",stdout);
scanf("%d",&n);
phi[1]=1;
for (i=2;i<=n;i++){
for (j=1;j<=cnt;j++)
if (i%p[j]==0) break;
if (j==cnt+1){
p[++cnt]=i;
phi[i]=i-1;
}
else{
for (k=i,ji=1;k%p[j]==0;k/=p[j],ji*=p[j]);
if (i!=ji) phi[i]=phi[ji]*phi[i/ji];
else phi[i]=i-i/p[j];
}
ans=(ans*phi[i])%100000007;
}
//print(phi,1,n,' ');
cout<<ans<<endl;
return 0;
}