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 Fortran (gfortran v4.8.4) (judge verdict: Accepted)

integer N,tmp
integer(8)ans
integer NumOfPrime(168),primenumbers(168)
read*,N
NumOfPrime=0
call getprime(1000,primenumbers)
do i=2,N
  tmp=i
  do j=1,168
    do while(mod(tmp,primenumbers(j))==0)
      NumOfPrime(j)=NumOfPrime(j)+1
      tmp=tmp/primenumbers(j)
    end do
  end do
end do
ans=1
do i=1,168
  ans=mod(ans*(NumOfPrime(i)+1),10**9+7)
end do
print"(i0)",ans
contains
subroutine getprime(N,array)
  integer N
  integer,dimension(:)::array
  integer ind
  logical pr
  array(1)=2;ind=1
  do i=3,N
    pr=.true.
    do j=1,ind
      if(mod(i,array(j))==0)then
        pr=.false.
        exit
      endif
    end do
    if(pr)then
      array(ind+1)=i;ind=ind+1
    endif
  end do
end subroutine
end