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)

# 素因数分解
def prime_factorization(N):
    tmp = N
    ans = []
    for i in range(2, int(N ** 0.5) + 1):
        count = 0
        while tmp % i == 0:
            tmp //= i
            count += 1
        if count != 0:
            ans.append([i, count])
    if tmp != 1:
        ans.append([tmp, 1])
    if ans == []:
        ans.append([N, 1])
    return ans


mod = 10 ** 9 + 7
N = int(input())
prime_list = [0] * N
if N == 1:
    print(1)
    exit()

for i in range(1, N+1):
    tmp_list = prime_factorization(i)
    ##print(i, tmp_list)
    for k in range(len(tmp_list)):
        prime_list[tmp_list[k][0]-1] += tmp_list[k][1]

ans = 1
for i in range(1, N):
    ans *= prime_list[i] + 1
    ans %= mod
##print(prime_list)
print(ans)