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 Haskell (GHC 7.10.3) (judge verdict: Accepted)

import Data.List( sort, group)
primes = 2:f [3] [3,5..]
 where f (x:xs) ys =	let
			    (ps, qs) = span (< x*x) ys
			in
			    ps ++ f (xs++ps) [z | z<-qs, z`mod`x/=0]

rpf n = let ps = takeWhile ((<=n).(^2)) primes
	in  if n==1 then [1] else go n ps
    where
	go 1 _	= []
	go i []	= [i]
	go i pp@(p:ps) = case i`divMod`p of
			(d,0)	-> p:go d pp
			_	-> go i ps 

main = do
    n_ <- readLn::IO Int
    print $ let
		ps = concatMap rpf [n_, n_-1..2]
		v=product $ map (toInteger . (+1) . length) $
				    group . sort $ ps
	    in	
		v `mod` 1000000007