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

#GL0000175. Tổng các ước của các số từ 1 đến n (Sum of Divisors)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tổng các ước của các số từ 1 đến n (Sum of Divisors)

Sum of Divisors

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

For a positive integer ii, let σ(i)\sigma(i) be the sum of all positive divisors of ii, including 11 and ii itself.

For example, the divisors of 1212 are 1,2,3,4,6,121,2,3,4,6,12, so σ(12)=28\sigma(12)=28.

Given a positive integer nn, compute

S=σ(1)+σ(2)+⋯+σ(n)S=\sigma(1)+\sigma(2)+\cdots+\sigma(n)

modulo 109+710^9+7.

Input

One line containing the integer nn.

Output

Print S mod (109+7)S\bmod(10^9+7).

Subtasks

  • Subtask 1 (20 points): 1≤n≤1051 \le n \le 10^5.
  • Subtask 2 (30 points): 1≤n≤1081 \le n \le 10^8.
  • Subtask 3 (50 points): 1≤n≤10121 \le n \le 10^{12}.

Examples

Example 1

Input

5

Output

21

Explanation

The divisor sums for 1,2,3,4,51,2,3,4,5 are 1,3,4,7,61,3,4,7,6. Therefore S=21S=21.