Problem:
Score : 300 points

Problem Statement

You are given an integer N.
Find the number of the positive divisors of N!, modulo 10^9+7.

Constraints

1≤N≤10^3

Input

The input is given from Standard Input in the following format:

N

Output

Print the number of the positive divisors of N!, modulo 10^9+7.

Sample Input 1

3

Sample Output 1

4

There are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.

Sample Input 2

6

Sample Output 2

30

Sample Input 3

1000

Sample Output 3

972926972

Solution in Pascal (FPC 2.6.2) (judge verdict: Accepted)

program ec12;
var 
	n,m,i,j,k,step,tot:longint;
	ans:int64;
	vis:array[1..1000] of boolean;
	prime,sum:array[1..500] of longint;
begin
	fillchar(sum,sizeof(sum),0);
	fillchar(vis,sizeof(vis),true);
	readln(n);
	tot:=0;
	for i:=2 to n do 
	begin 
		if vis[i] then 
		begin 
			inc(tot);
			prime[tot]:=i;
		end;
		for j:=1 to tot do 
		begin 
			if prime[j]*i>1000 then 
			break;
			vis[prime[j]*i]:=false;
			if i mod prime[j]=0 then 
			break;
		end;
	end;
	for i:=2 to n do 
	begin 
		if vis[i] then 
		begin 
			for j:=1 to tot do 
			begin 
				if prime[j]=i then 
				break;
			end;
			if prime[j]=i then
			inc(sum[j]);
		end
		else
		begin 
			step:=1;
			k:=i;
			while k>=prime[step] do 
			begin 
				if k mod prime[step]=0 then 
				begin 
					inc(sum[step]);
					k:=k div prime[step];
				end
				else
				inc(step);
			end;
		end;
	end;
	ans:=1;
	for i:=1 to tot do
	begin 
		if sum[i]>0 then 
		ans:=(ans*(sum[i]+1)) mod 1000000007;
	end;
	writeln(ans);
end.