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 Java8 (OpenJDK 1.8.0) (judge verdict: Accepted)

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();

		long MOD = 1000000007L;

		boolean[] chk = new boolean[1010];
		Arrays.fill(chk, true);
		int[] prime = new int[1000];
		int cnt = 0;
		for (int i = 2; i <= 1000; i++) {
			if (chk[i]) {
				prime[cnt++] = i;
				int x = 2 * i;
				while (x <= 1000) {
					chk[x] = false;
					x += i;
				}
			}
		}

		long ans = 1L;
		for (int i = 0; i < cnt; i++) {
			int factor = 0;

			for (int j = 2; j <= N; j++) {
				int cur = j;
				while (cur >= prime[i]) {
					if (cur % prime[i] == 0) {
						factor++;
						cur = cur / prime[i];
					} else {
						break;
					}
				}
			}
			ans = (ans * (factor + 1)) % MOD;
		}
		System.out.println(ans);
	}
}