PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000209. Đếm số ước của giai thừa (Divisors of Factorial)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm số ước của giai thừa (Divisors of Factorial)

Divisors of Factorial

Source: SPOJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given a nonnegative integer NN, count the positive divisors of N!N!, with 0!=10!=1. Since the answer may be very large, output it modulo 109+710^9+7.

Two divisors are distinct if they have different integer values. For example, 4!=244!=24 has the eight divisors 1,2,3,4,6,8,12,241,2,3,4,6,8,12,24.

Input

The only line contains the integer NN.

Output

Print the number of positive divisors of N!N! modulo 109+710^9+7.

Subtasks

  • Subtask 1 (20 points): 0≤N≤1000\le N\le 100.
  • Subtask 2 (30 points): 0≤N≤50000\le N\le 5000.
  • Subtask 3 (50 points): 0≤N≤500000\le N\le 50000.

Examples

Input

4

Output

8

Explanation

4!=24=23⋅314!=24=2^3\cdot3^1. We may choose the exponent of 22 from {0,1,2,3}\{0,1,2,3\} and that of 33 from {0,1}\{0,1\}. Thus there are (3+1)(1+1)=8(3+1)(1+1)=8 positive divisors, unchanged modulo 109+710^9+7.