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 C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair

const int MAX_N = 1005;
const int MOD = 1e9+7;
int N;

map<int, int> primeCount;

void factor(int n)
{
	for(int i=2;i*i<=n;++i){
		int cnt = 0;
		while(n%i==0){
			n/=i;
			cnt++;
		}
		primeCount[i] += cnt;
	}
	if(n>1) primeCount[n]++;
}

void solve()
{
	for(int i=1; i<=N; ++i) factor(i);
	ll ans = 1;
	for(auto& p : primeCount){
		ans = (ans * (p.second+1))%MOD;
	}
	cout << ans << endl;
}

int main()
{
	cin >> N;
	solve();
}