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 PyPy3 (2.4.0) (judge verdict: Accepted)

import math
import sys
input = sys.stdin.readline
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字

mod = 10 ** 9 + 7
ans = 0
def eratos(num):
    dp = [True] * (num)
    dp[0] = dp[1] = False # 0, 1をFalseに
    sqrt_num = int(num ** 0.5) + 1
    for i in range(2, sqrt_num):
        if dp[i]:
            for j in range(i**2, num, i):
                dp[j] = False
    primes = []
    for index, k in enumerate(dp):
        if k:
            primes.append(index)
    return primes
primes = eratos(n + 1)

m = []
for p in primes:
    t = 0
    for i in range(1, n + 1):
        while i % p == 0:
            t += 1
            i //= p
    m.append(t)
ans = 1
for k in m:
    ans *= (k + 1) % mod
print(ans % mod)