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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
using System.Collections.Generic;
using System.Linq;
using static AtCoder.Io;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            var mod = (long)Math.Pow(10, 9) + 7;
            var n = ReadInt();

            var primes = new[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
            var exponents = new Dictionary<int, int>();
            for (int i = 1; i <= n; i++)
            {
                var value = i;
                foreach (var prime in primes)
                {
                    var count = 0;
                    while (value % prime == 0)
                    {
                        count++;
                        value /= prime;
                    }
                    if (count != 0)
                    {
                    }
                    if (!exponents.ContainsKey(prime)) exponents.Add(prime, 0);
                    exponents[prime] += count;
                }
                if (value != 1)
                {
                    if (!exponents.ContainsKey(value)) exponents.Add(value, 0);
                    exponents[value]++;
                }
            }

            long ans = 1;
            foreach (var exponent in exponents)
            {
                ans = ans * (exponent.Value + 1) % mod;
            }
            Console.WriteLine(ans);
        }
    }

    public static class Io
    {
        public static string ReadString() => Console.ReadLine();
        public static string[] ReadStringArray() => ReadString().Split(' ');
        public static int ReadInt() => int.Parse(ReadString());
        public static long ReadLong() => long.Parse(ReadString());
        public static int[] ReadIntArray() => ReadStringArray().ParseInt().ToArray();
        public static long[] ReadLongArray() => ReadStringArray().ParseLong().ToArray();
        public static IEnumerable<int> ParseInt(this IEnumerable<string> source) => source.Select(int.Parse);
        public static IEnumerable<long> ParseLong(this IEnumerable<string> source) => source.Select(long.Parse);
    }
}