#GYM104666B. Be Geeks!

Be Geeks!

Description

The musical band Be Geeks! got its name by no accident, as all the members are genuine math geeks. Among others, they love examining various properties of number sequences. Let's see an example of their subject of interest.

Let $A$ be a nonempty sequence of positive integers, $A = (a_1, a_2, \ldots , a_N )$.

Let $G(i, j) = \gcd(a_i, a_{i+1}, \ldots , a_j )$, where $1 \leq i \leq j \leq N$.

Let $M(i, j) = \max(a_i, a_{i+1}, \ldots , a_j )$, where $1 \leq i \leq j \leq N$.

Let $P(i, j) = G(i, j) \cdot M(i, j)$, where $1 \leq i \leq j \leq N$.

Let $F(A) = \sum P(i, j)$ over all pairs of integers $1 \leq i \leq j \leq N$.

The function gcd stands for the greatest common divisor of the given values. The greatest common divisor of a nonempty sequence of integers is the biggest integer which divides each integer in the sequence evenly.

The first line contains one integer $N$ ($1 \leq N \leq 2 \cdot 10^5$). The next line contains $N$ integers $a_1, a_2, \ldots , a_N$ ($1 \leq a_i \leq 10^9$).

Print the value of $F(A)$ modulo $1\ 000\ 000\ 007$.

Input

The first line contains one integer $N$ ($1 \leq N \leq 2 \cdot 10^5$). The next line contains $N$ integers $a_1, a_2, \ldots , a_N$ ($1 \leq a_i \leq 10^9$).

Output

Print the value of $F(A)$ modulo $1\ 000\ 000\ 007$.

4
1 2 3 4
5
2 4 6 12 3
50
457