def prime_factorize(n):

    i = 2

    res = {}

    while i * i <= n:

        if n % i != 0:

            i += 1

            continue

        res[i] = 0

        while n % i == 0:

            res[i] += 1

            n //= i

        i += 1

    if n != 1:

        res[n] = 1

    return res





n = int(eval(input()))

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

MOD = 10 ** 9 + 7

lcm_ppf = prime_factorize(aaa[0])

for a in aaa[1:]:

    for p, c in list(prime_factorize(a).items()):

        if p in lcm_ppf:

            lcm_ppf[p] = max(lcm_ppf[p], c)

        else:

            lcm_ppf[p] = c



lcm = 1

for p, c in list(lcm_ppf.items()):

    lcm = lcm * pow(p, c, MOD) % MOD

# print(lcm)



ans = 0

for a in aaa:

    ra = pow(a, MOD - 2, MOD)

    ans = (ans + lcm * ra) % MOD

print(ans)

from fractions import gcd



n = int(eval(input()))

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

MOD = 10 ** 9 + 7

lcm = aaa[0]

for a in aaa[1:]:

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

lcm %= MOD



ans = 0

for a in aaa:

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

print(ans)

def prime_factorize(n):
    i = 2
    res = {}
    while i * i <= n:
        if n % i != 0:
            i += 1
            continue
        res[i] = 0
        while n % i == 0:
            res[i] += 1
            n //= i
        i += 1
    if n != 1:
        res[n] = 1
    return res


n = int(eval(input()))
aaa = list(map(int, input().split()))
MOD = 10**9 + 7
lcm_ppf = prime_factorize(aaa[0])
for a in aaa[1:]:
    for p, c in list(prime_factorize(a).items()):
        if p in lcm_ppf:
            lcm_ppf[p] = max(lcm_ppf[p], c)
        else:
            lcm_ppf[p] = c
lcm = 1
for p, c in list(lcm_ppf.items()):
    lcm = lcm * pow(p, c, MOD) % MOD
# print(lcm)
ans = 0
for a in aaa:
    ra = pow(a, MOD - 2, MOD)
    ans = (ans + lcm * ra) % MOD
print(ans)

from fractions import gcd

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

-def prime_factorize(n): -    i = 2 -    res = {} -    while i * i <= n: -        if n % i != 0: -            i += 1 -            continue -        res[i] = 0 -        while n % i == 0: -            res[i] += 1 -            n //= i -        i += 1 -    if n != 1: -        res[n] = 1 -    return res - +from fractions import gcd -lcm_ppf = prime_factorize(aaa[0]) +lcm = aaa[0] -    for p, c in list(prime_factorize(a).items()): -        if p in lcm_ppf: -            lcm_ppf[p] = max(lcm_ppf[p], c) -        else: -            lcm_ppf[p] = c -lcm = 1 -for p, c in list(lcm_ppf.items()): -    lcm = lcm * pow(p, c, MOD) % MOD -# print(lcm) +    lcm = lcm * a // gcd(lcm, a) +lcm %= MOD -    ra = pow(a, MOD - 2, MOD) -    ans = (ans + lcm * ra) % MOD +    ans = (ans + lcm * pow(a, MOD - 2, MOD)) % MOD