Problem Description
Little Ponny just came back from his Number Theory Class and is trying to relax himself a bit.
He was reading about the proper fractions and then started to write some of them in his notebook.
He picked a denominator to write down the numbers.
Let's say K and wrote all the possible proper fractions considering only integer numerators, i.e., 0/K, 1/K, 2/K,....., (K-2)/K, and (K-1)/K in their reduced form.
He did this for all K from 1 to N.
Given a number N, Calculate the total number of distinct fractions he wrote in his notebook.
Note:
Two Fractions P1/Q1, and P2/Q2 are different if either P1 ≠ P2 or Q1 ≠ Q2. (we will compare the reduced for of fraction i.e., 4/10 and 6/15 are same because they both are 2/5 in their reduced form).
Since the answer can be very large, return answer modulo 109+7
Problem Constraints
1 ≤ N ≤ 106
Input Format
The input contains one and only argument i.e, N.
Output Format
Return a single integer corresponding to the answer.
Example Input
Input 1:
N = 3
Input 2:
N = 5
Example Output
Output 1:
4
Output 2:
12
Example Explanation
Explanation 1:
There are following fractions, he will write in the notebook.
For denominator 1: [0/1]
For denominator 2: [0/2, 1/2]
For denominator 3: [0/3, 1/3, 2/3]
The distinct fractions are 0, 1/2, 1/3, 2/3.
Explanation 2:
There are following fractions, he will write in the notebook.
For denominator 1: [0/1]
For denominator 2: [0/2, 1/2]
For denominator 3: [0/3, 1/3, 2/3]
For denominator 4: [0/4, 1/4, 2/4 = 1/2, 3/4]
For denominator 5: [0/5, 1/5, 2/5, 3/5, 4/5]
For denominator 6: [0/6, 1/6, 2/6 = 1/3, 3/6 = 1/2, 4/6 = 2/3, 5/6]
The distinct fractions are 0, 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6.