#abc152e. [abc152_e]Flatten

[abc152_e]Flatten

Problem Statement

Given are NN positive integers A1,...,ANA_1,...,A_N.

Consider positive integers B1,...,BNB_1, ..., B_N that satisfy the following condition.

Condition: For any i,ji, j such that 1leqi<jleqN1 \\leq i < j \\leq N, AiBi=AjBjA_i B_i = A_j B_j holds.

Find the minimum possible value of B1+...+BNB_1 + ... + B_N for such B1,...,BNB_1,...,B_N.

Since the answer can be enormous, print the sum modulo (109+710^9 +7).

Constraints

  • 1leqNleq1041 \\leq N \\leq 10^4
  • 1leqAileq1061 \\leq A_i \\leq 10^6
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN A1A_1 ...... ANA_N

Output

Print the minimum possible value of B1+...+BNB_1 + ... + B_N for B1,...,BNB_1,...,B_N that satisfy the condition, modulo (109+710^9 +7).


Sample Input 1

3
2 3 4

Sample Output 1

13

Let B1=6B_1=6, B2=4B_2=4, and B3=3B_3=3, and the condition will be satisfied.


Sample Input 2

5
12 12 12 12 12

Sample Output 2

5

We can let all BiB_i be 11.


Sample Input 3

3
1000000 999999 999998

Sample Output 3

996989508

Print the sum modulo (109+7)(10^9+7).