#P5153. 简单的函数

简单的函数

Description

HKE once discovered a very interesting function.

Define f(2)=1f(2) = 1. For n3n \geq 3, let tt be the smallest positive integer such that nn is not divisible by tt, then f(n)=f(t)+1f(n) = f(t) + 1.

For example, when n=6n = 6, we have t=4t = 4, and f(6)=f(4)+1=f(3)+2=f(2)+3=4f(6) = f(4) + 1 = f(3) + 2 = f(2) + 3 = 4.

Now, HKE wants to know the value of f(2)×f(3)××f(n)f(2) \times f(3) \times \cdots \times f(n). The answer can be large; please take it modulo 109+710^9 + 7.

Input Format

A single line containing a positive integer nn.

Output Format

A single line with the required result.

4
6

Hint

  • For 30%30\% of the testdata, n1000n \leq 1000.
  • For 50%50\% of the testdata, n1,000,000n \leq 1{,}000{,}000.
  • For 100%100\% of the testdata, n1018n \leq 10^{18}.

Translated by ChatGPT 5