from fractions import gcd



mod = 10 ** 9 + 7



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



L = 1

for a in A:

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



print((sum(L // a for a in A) % mod))
from fractions import gcd



mod = 10 ** 9 + 7



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



L = 1

for a in A:

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



L %= mod



print((sum(L * pow(a, mod - 2, mod) % mod for a in A) % mod))
from fractions import gcd

mod = 10**9 + 7
N, *A = list(map(int, open(0).read().split()))
L = 1
for a in A:
    L *= a // gcd(L, a)
print((sum(L // a for a in A) % mod))

from fractions import gcd

mod = 10**9 + 7
N, *A = list(map(int, open(0).read().split()))
L = 1
for a in A:
    L *= a // gcd(L, a)
L %= mod
print((sum(L * pow(a, mod - 2, mod) % mod for a in A) % mod))

-print((sum(L // a for a in A) % mod)) +L %= mod +print((sum(L * pow(a, mod - 2, mod) % mod for a in A) % mod))