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 C;
const 
  maxN = 1111;
  modulo = Round(1E9) + 7;
var
  n, x, i, j: Longint;
  fact: array[1..maxN] of Longint;
  ans: Int64;
  
begin
  ReadLn(n);
  for i := 1 to n do
    begin
      x := i;
      for j := 2 to n do
        if x mod j = 0 then
          while x mod j = 0 do
            begin
              Inc(fact[j]);
              x := x div j;
            end;
    end;
  ans := 1;
  for i := 2 to n do
    if fact[i] > 0 then 
      ans := ans * (fact[i] + 1) mod modulo;
  WriteLn(ans);
end.