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)

import math

N = int(input())


#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor

prime_cnt = {}
for i in range(1, N + 1):
  ps = trial_division(i)
  if ps == "prime number":
    ps = [i]
  for d in ps:
    if d == 1:
      continue
    if d in prime_cnt:
      prime_cnt[d] += 1
    else:
      prime_cnt[d] = 1
      
#print(prime_cnt)
  
ans = 1
for d in prime_cnt:
  ans *= prime_cnt[d] + 1
  ans %= 1000000007
  
print(ans)