import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { Scanner sc=new Scanner(System.in); int M=sc.nextInt(); new Main().run(M); } final long MOD=(long)1e9+7; long pow(long a,long n) { n%=MOD-1; long ret=1; for(;n>0;n>>=1,a=a*a%MOD)if(n%2==1)ret=ret*a%MOD; return ret; } long inv(long a) { return pow(a,MOD-2); } long solve(long p,int e) { long[][][] dp=new long[e+1][e+2][e+1];//dp[i][j][k]:=p^i使用済み,p^jまで見た,k要素決定。 dp[0][e+1][0]=1; for(int i=0;i=1;--j) { for(int n=0;n=1;--k) { for(int l=1;l<=e;++l) { if(i+k*l>e||(k==1&&i+k*l!=e))continue; //(Z/p^k)^l long add=1; for(int m=0;m0) ans=ans*solve(div,e)%MOD; } ans=ans*fac%MOD; System.out.println(ans); } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }