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 <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define mod ((ull)(1e9)+7)

bool is_prime(ull n){
	for(ull i=2; i*i<=n; i++){
		if(n%i==0) return false;
	}
	return true;
}

void make_prime(vector<ull> &prime){
	prime.push_back(2);
	for(ull i=3; i<=1000; i+=2){
		if(is_prime(i)) prime.push_back(i);
	}
}

int main(){
	ull n;
	cin >> n;
	if(n==1){
		cout << 1 << endl;
		return 0;
	}
	vector<ull> prime;
	make_prime(prime);

	ull cnt[prime.size()];
	for(ull i=0; i<prime.size(); i++) cnt[i]=0;
	for(ull i=2; i<=n; i++){
		ull k=i;
		for(ull j=0; j<prime.size(); j++){
			while(k%prime[j]==0){
				cnt[j]++;
				k/=prime[j];
			}
		}
	}
	ull ans=1;
	for(int i=0; i<prime.size(); i++){
		ans*=cnt[i]+1;
		ans%=mod;
	}
	cout << ans << endl;
	return 0;
}