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

#SRD0000127. Tổng các số dư (Sum of Remainders)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Tổng các số dư (Sum of Remainders)

Sum of Remainders

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers n,mn,m, compute S=∑i=1m(n mod i)S=\sum_{i=1}^{m}(n\bmod i), modulo 109+710^9+7. Here n mod in\bmod i is the remainder on division by ii.

Input

One line with two integers n,mn,m.

Output

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

Subtasks

  • Subtask 1 (10 points): 1≤n,m≤501\le n,m\le50.
  • Subtask 2 (20 points): 1≤n,m≤1051\le n,m\le10^5.
  • Subtask 3 (30 points): 1≤n,m≤1091\le n,m\le10^9.
  • Subtask 4 (40 points): 1≤n,m≤10131\le n,m\le10^{13} (full original limits).

Examples

Example 1

Input

3 4

Output

4

Explanation: 3 mod 1,3 mod 2,3 mod 3,3 mod 43\bmod1,3\bmod2,3\bmod3,3\bmod4 are 0,1,0,30,1,0,3; their sum is 44.

Example 2

Input

4 4

Output

1

Explanation: The remainders sum to 0+0+1+0=10+0+1+0=1.

Example 3

Input

1 1

Output

0

Explanation: 1 mod 1=01\bmod1=0.