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

#GL0000086. Hàm số kỳ lạ (Strange Function)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Hàm số kỳ lạ (Strange Function)

Strange Function

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

For every positive integer ii, let f(i)f(i) be the smallest positive integer that does not divide ii. For example, f(4)=3f(4)=3, since both 11 and 22 divide 44 but 33 does not. Given a positive integer nn, compute f(1)+f(2)+⋯+f(n)f(1)+f(2)+\cdots+f(n) modulo 109+710^9+7.

Input

One line containing an integer nn.

Output

Print the required sum modulo 109+710^9+7.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1031\le n\le 10^3
  • Subtask 2 (30 points): 1≤n≤1091\le n\le 10^9
  • Subtask 3 (50 points): 1≤n≤10161\le n\le 10^{16}

Examples

Input

10

Output

26

Explanation

For i=1,2,…,10i=1,2,\ldots,10, the values of f(i)f(i) are 2,3,2,3,2,4,2,3,2,32,3,2,3,2,4,2,3,2,3. Their sum is 2626.