from functools import reduce

MOD = 10**9+7

n = int(eval(input()))

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





def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)





def lcm(a, b):

    return a*(b//gcd(a, b))





x = reduce(lcm, A) % MOD

print((sum(x*pow(a, MOD-2, MOD) for a in A) % MOD))
from collections import defaultdict

MOD = 10**9+7

n = int(eval(input()))

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





def sieve(n):

    res = [i for i in range(n)]

    for i in range(2, int(n**.5)+1):

        if res[i] < i:

            continue

        for j in range(i**2, n, i):

            if res[j] == j:

                res[j] = i

    return res





U = 10**6+1

min_factor = sieve(U)





def prime_factor(n):

    res = defaultdict(lambda: 0)

    while 1 < n:

        res[min_factor[n]] += 1

        n //= min_factor[n]

    return res





pf = defaultdict(lambda: 0)



for a in A:

    for p, q in list(prime_factor(a).items()):

        if pf[p] < q:

            pf[p] = q



x = 1

for p, q in list(pf.items()):

    x *= pow(p, q, MOD)

x %= MOD



print((sum(x*pow(a, MOD-2, MOD) for a in A) % MOD))
from functools import reduce

MOD = 10**9 + 7
n = int(eval(input()))
A = list(map(int, input().split()))


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return a * (b // gcd(a, b))


x = reduce(lcm, A) % MOD
print((sum(x * pow(a, MOD - 2, MOD) for a in A) % MOD))

from collections import defaultdict

MOD = 10**9 + 7
n = int(eval(input()))
A = list(map(int, input().split()))


def sieve(n):
    res = [i for i in range(n)]
    for i in range(2, int(n**0.5) + 1):
        if res[i] < i:
            continue
        for j in range(i**2, n, i):
            if res[j] == j:
                res[j] = i
    return res


U = 10**6 + 1
min_factor = sieve(U)


def prime_factor(n):
    res = defaultdict(lambda: 0)
    while 1 < n:
        res[min_factor[n]] += 1
        n //= min_factor[n]
    return res


pf = defaultdict(lambda: 0)
for a in A:
    for p, q in list(prime_factor(a).items()):
        if pf[p] < q:
            pf[p] = q
x = 1
for p, q in list(pf.items()):
    x *= pow(p, q, MOD)
x %= MOD
print((sum(x * pow(a, MOD - 2, MOD) for a in A) % MOD))

-from functools import reduce +from collections import defaultdict -def gcd(a, b): -    if b == 0: -        return a -    return gcd(b, a % b) +def sieve(n): +    res = [i for i in range(n)] +    for i in range(2, int(n**0.5) + 1): +        if res[i] < i: +            continue +        for j in range(i**2, n, i): +            if res[j] == j: +                res[j] = i +    return res -def lcm(a, b): -    return a * (b // gcd(a, b)) +U = 10**6 + 1 +min_factor = sieve(U) -x = reduce(lcm, A) % MOD +def prime_factor(n): +    res = defaultdict(lambda: 0) +    while 1 < n: +        res[min_factor[n]] += 1 +        n //= min_factor[n] +    return res + + +pf = defaultdict(lambda: 0) +for a in A: +    for p, q in list(prime_factor(a).items()): +        if pf[p] < q: +            pf[p] = q +x = 1 +for p, q in list(pf.items()): +    x *= pow(p, q, MOD) +x %= MOD