from fractions import gcd



MOD = 1000000000 + 7



N = int(eval(input()))

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



l = 1

ans = 0

for a in A:

    g = gcd(a, l)

    l = (l // g) * a

    ans = (ans * (a // g)) % MOD

    ans = (ans + (l // a)) % MOD

print((int(ans)))

from fractions import gcd



MOD = 1000000000 + 7



N = int(eval(input()))

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



def fact(a, n):

    r = 1

    while (n > 0):

        if (n & 1):

            r = (r * a) % MOD

        a = (a * a) % MOD

        n //= 2

    return r



def modinv(a):

    return fact(a, MOD-2)



l = 1

ans = 0

for a in A:

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

l %= MOD

ans = 0

for a in A:

    ans += (l * modinv(a)) % MOD

print((ans % MOD))

from fractions import gcd

MOD = 1000000000 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
l = 1
ans = 0
for a in A:
    g = gcd(a, l)
    l = (l // g) * a
    ans = (ans * (a // g)) % MOD
    ans = (ans + (l // a)) % MOD
print((int(ans)))

from fractions import gcd

MOD = 1000000000 + 7
N = int(eval(input()))
A = list(map(int, input().split()))


def fact(a, n):
    r = 1
    while n > 0:
        if n & 1:
            r = (r * a) % MOD
        a = (a * a) % MOD
        n //= 2
    return r


def modinv(a):
    return fact(a, MOD - 2)


l = 1
ans = 0
for a in A:
    l = l * a // gcd(a, l)
l %= MOD
ans = 0
for a in A:
    ans += (l * modinv(a)) % MOD
print((ans % MOD))

+ + +def fact(a, n): +    r = 1 +    while n > 0: +        if n & 1: +            r = (r * a) % MOD +        a = (a * a) % MOD +        n //= 2 +    return r + + +def modinv(a): +    return fact(a, MOD - 2) + + -    g = gcd(a, l) -    l = (l // g) * a -    ans = (ans * (a // g)) % MOD -    ans = (ans + (l // a)) % MOD -print((int(ans))) +    l = l * a // gcd(a, l) +l %= MOD +ans = 0 +for a in A: +    ans += (l * modinv(a)) % MOD +print((ans % MOD))