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)

from collections import defaultdict

MOD = 1000000007


def prime_generator(limit):
    yield 2
    n, h = 3, {}
    while n <= limit:
        m = n
        if n in h:
            b = h[n]
            m += 2 * b
            while m in h:
                m += 2 * b
            h[m] = b
            del h[n]
        else:
            m += 2 * n
            while m in h:
                m += 2 * n
            h[m] = n
            yield n
        n += 2


def solve(n):
    ps = list(prime_generator(n))
    prev = defaultdict(int)
    for i in range(1, n):
        f = prev.copy()
        k = i + 1
        for p in ps:
            while k % p == 0:
                k //= p
                f[p] += 1
            if k == 1:
                break
        prev = f

    ans = 1
    for c in prev.values():
        ans *= c + 1
        ans %= MOD
    return ans


print(solve(int(input())))