from fractions import gcd





MOD = 10 ** 9 + 7

N = int(eval(input()))

A = list(map(int, input().split()))

A.sort(reverse=True)



lcm = A[0]



for a in A:

    lcm = (lcm * a) // gcd(lcm, a)



ans = 0

for a in A:

    ans += (lcm % MOD) * pow(a, MOD - 2, MOD)

    ans %= MOD



print(ans)

from fractions import gcd





MOD = 10 ** 9 + 7

N = int(eval(input()))

A = list(map(int, input().split()))

A.sort(reverse=True)



lcm = A[0]



for a in A:

    lcm = (lcm * a) // gcd(lcm, a)



ans = 0

lcm %= MOD

for a in A:

    ans += lcm * pow(a, MOD - 2, MOD)

    ans %= MOD



print(ans)

from fractions import gcd

MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
lcm = A[0]
for a in A:
    lcm = (lcm * a) // gcd(lcm, a)
ans = 0
for a in A:
    ans += (lcm % MOD) * pow(a, MOD - 2, MOD)
    ans %= MOD
print(ans)

from fractions import gcd

MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
A.sort(reverse=True)
lcm = A[0]
for a in A:
    lcm = (lcm * a) // gcd(lcm, a)
ans = 0
lcm %= MOD
for a in A:
    ans += lcm * pow(a, MOD - 2, MOD)
    ans %= MOD
print(ans)

+lcm %= MOD -    ans += (lcm % MOD) * pow(a, MOD - 2, MOD) +    ans += lcm * pow(a, MOD - 2, MOD)