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)

//C - Factors of Factorial: 
//Assunto: Math/ Fatorial/ Divisores
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define loop(i, a, b) for(int i = a; i < b; i++)
#define loopBack(i, a, b) for(int i = a; i >= b; i--)
#define INF INT_MAX
#define LINF LLONG_MAX
#define DINF DBL_MAX
#define MAX 100050
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

map<int, int> factors;

void primeFactor(int x) {
    for(int i = 2; i * i <= x; i++) {
        while(x % i == 0) {
            factors[i]++;
            x /= i;
        }
    }
    if(x > 1) factors[x]++;
}

ll solve(int n) {
    ll a = 1;
    for(int i = n; i > 0; i--) primeFactor(i);
    for(auto x : factors) a = ((a % MOD) * ((x.se+1) % MOD)) % MOD;
    return a % MOD;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    int n;
    ll ans;

    cin >> n;
    ans = solve(n);
    cout << ans << "\n";
}