import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from fractions import gcd

from functools import reduce



N,*A = list(map(int,read().split()))



MOD = 10 ** 9 + 7



lcm = 1

answer = 0

for x in A:

  n = x//gcd(lcm,x)

  lcm *= n

  answer *= n 

  answer %= MOD

  answer += lcm//x % MOD

  

answer %= MOD

print(answer)

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from fractions import gcd

from functools import reduce



N,*A = list(map(int,read().split()))



MOD = 10 ** 9 + 7



lcm = 1

answer = 0

for x in A:

  n = x//gcd(lcm,x)

  lcm *= n

  answer *= n

  answer += lcm//x

  

answer %= MOD

print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from fractions import gcd
from functools import reduce

N, *A = list(map(int, read().split()))
MOD = 10**9 + 7
lcm = 1
answer = 0
for x in A:
    n = x // gcd(lcm, x)
    lcm *= n
    answer *= n
    answer %= MOD
    answer += lcm // x % MOD
answer %= MOD
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from fractions import gcd
from functools import reduce

N, *A = list(map(int, read().split()))
MOD = 10**9 + 7
lcm = 1
answer = 0
for x in A:
    n = x // gcd(lcm, x)
    lcm *= n
    answer *= n
    answer += lcm // x
answer %= MOD
print(answer)

-    answer %= MOD -    answer += lcm // x % MOD +    answer += lcm // x