#include<stdio.h>
#define M 1000000007

int powmod(long long a,int n,int m){
	long long x=1;
	a%=m;
	while(n){
		if(n%2)x=x*a%m;
		a=a*a%m;
		n/=2;
	}
	return x;
}

int ee[100]={100};//番兵

int dfs(int p,int rest,int cnt){
	if(rest==0){
		long long ans=1;
		ee[cnt+1]=0;//番兵
		int idx=0;
		for(int i=1;i<=cnt;i++){
			int c=i,d=i;
			while(ee[c+1]==ee[i])c++;
			while(ee[d-1]==ee[i])d--;
			ans=ans*(powmod(p,cnt+1-d,M)-powmod(p,cnt-i,M))%M;
			idx+=ee[i]*(d-1)+(ee[i]-1)*c;
		}
		ans=ans*powmod(p,idx,M)%M;
		return powmod(ans,M-2,M);
	}
	
	long long ans=0;
	for(int i=1;i<=ee[cnt]&&i<=rest;i++){
		ee[cnt+1]=i;
		ans+=dfs(p,rest-i,cnt+1);
	}
	return ans%M;
}

int f(int n){
	long long ans=1;
	for(int i=1;i<=n;i++)ans=ans*i%M;
	
	for(int p=2;p*p<=n;p++)if(n%p==0){
		int e=0;
		while(n%p==0)n/=p,e++;
		ans=ans*dfs(p,e,0)%M;
	}
	if(n!=1)ans=ans*dfs(n,1,0)%M;
	return (ans+M)%M;
}

int main(){
	int n;
	scanf("%d",&n);
	printf("%d\n",f(n));
}