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 Python (3.4.3) (judge verdict: Accepted)

# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
from collections import defaultdict
N = int(input())

Primes = []
is_prime = [True]*(N+1)
is_prime[0] = is_prime[1] = False

for i in range(2,N+1):
    if is_prime[i]:
        Primes.append(i)
        for j in range(i*2,N+1,i):
            is_prime[j] = False

dic = defaultdict(int)

for i in range(2,N+1):
    for p in Primes:
        while i%p==0:
            dic[p] += 1
            i //= p
        if i==1:
            break

ans = 1
mod = 10**9+7
for v in dic.values():
    ans *= v+1
    ans %= mod

print(ans)