from fractions import gcd

from functools import reduce



MOD = 10 ** 9 + 7

N = int(eval(input()))

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



L = reduce(lambda x, y: x * y // gcd(x, y), A)



ans = 0

for i in range(N):

    ans += L // A[i]

print((ans % MOD))

from collections import Counter, defaultdict



MOD = 10 ** 9 + 7

N = int(eval(input()))

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



max_A = max(A)

f = list(range(max_A + 1))

for i in range(2, int(max_A ** 0.5) + 1):

    if f[i] == i:

        f[i::i] = [i] * (max_A // i)





def factors(x):

    factor = defaultdict(int)

    while x != 1:

        factor[f[x]] += 1

        x //= f[x]

    return factor





L = defaultdict(int)

for i in range(N):

    Ai = factors(A[i])

    for p, index in list(Ai.items()):

        L[p] = max(L[p], index)

lcm = 1

for p, index in list(L.items()):

    if index == 0:

        continue

    lcm *= pow(p, index, MOD)

    lcm %= MOD



ans = 0

for Ai in A:

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

    ans %= MOD

print((ans % MOD))

from fractions import gcd
from functools import reduce

MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
L = reduce(lambda x, y: x * y // gcd(x, y), A)
ans = 0
for i in range(N):
    ans += L // A[i]
print((ans % MOD))

from collections import Counter, defaultdict

MOD = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
max_A = max(A)
f = list(range(max_A + 1))
for i in range(2, int(max_A**0.5) + 1):
    if f[i] == i:
        f[i::i] = [i] * (max_A // i)


def factors(x):
    factor = defaultdict(int)
    while x != 1:
        factor[f[x]] += 1
        x //= f[x]
    return factor


L = defaultdict(int)
for i in range(N):
    Ai = factors(A[i])
    for p, index in list(Ai.items()):
        L[p] = max(L[p], index)
lcm = 1
for p, index in list(L.items()):
    if index == 0:
        continue
    lcm *= pow(p, index, MOD)
    lcm %= MOD
ans = 0
for Ai in A:
    ans += lcm * pow(Ai, MOD - 2, MOD)
    ans %= MOD
print((ans % MOD))

-from fractions import gcd -from functools import reduce +from collections import Counter, defaultdict -L = reduce(lambda x, y: x * y // gcd(x, y), A) +max_A = max(A) +f = list(range(max_A + 1)) +for i in range(2, int(max_A**0.5) + 1): +    if f[i] == i: +        f[i::i] = [i] * (max_A // i) + + +def factors(x): +    factor = defaultdict(int) +    while x != 1: +        factor[f[x]] += 1 +        x //= f[x] +    return factor + + +L = defaultdict(int) +for i in range(N): +    Ai = factors(A[i]) +    for p, index in list(Ai.items()): +        L[p] = max(L[p], index) +lcm = 1 +for p, index in list(L.items()): +    if index == 0: +        continue +    lcm *= pow(p, index, MOD) +    lcm %= MOD -for i in range(N): -    ans += L // A[i] +for Ai in A: +    ans += lcm * pow(Ai, MOD - 2, MOD) +    ans %= MOD