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 OCaml (4.02.3) (judge verdict: Accepted)

(* O(n^2 log n) *)
let n = read_int ()
let is_prime n =
  if n <= 1 then false
  else
    let rec loop i =
      if i * i > n then true
      else if n mod i = 0 then false
      else loop @@ i + 1 in
    loop 2
let rec div_count n i = if n mod i <> 0 then 0 else 1 + div_count (n / i) i
let ans = ref 1
let _ =
  for i = 2 to n do
    if is_prime i then 
      let c = ref 0 in
      for j = 2 to n do c := !c + div_count j i done;
      ans := !ans * (!c + 1) mod 1_000_000_007 done;
  Printf.printf "%d\n" @@ !ans