from functools import reduce

from fractions import gcd



N = int(eval(input()))

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

 

MOD = 10 ** 9 + 7

 

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

lcm %= MOD



coef = sum(pow(a, MOD-2, MOD) for a in A)

ans = lcm * coef % MOD



print(ans)
N = int(eval(input()))

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



from collections import defaultdict



MOD = 10**9 + 7



primes = defaultdict(int)



for a in A:

    p = 2

    while p * p <= a:

        if a % p == 0:

            cnt = 0

            while a % p == 0:

                cnt += 1

                a //= p

            primes[p] = max(primes[p], cnt)

        p += 1

    if a != 1:

        if a not in primes:

            primes[a] = 1



lcm = 1

for p in primes:

    lcm = lcm * pow(p, primes[p], MOD) % MOD



ans = 0

for a in A:

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

    ans %= MOD



print(ans)
from functools import reduce
from fractions import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
lcm = reduce(lambda x, y: x * (y // gcd(x, y)), A)
lcm %= MOD
coef = sum(pow(a, MOD - 2, MOD) for a in A)
ans = lcm * coef % MOD
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
from collections import defaultdict

MOD = 10**9 + 7
primes = defaultdict(int)
for a in A:
    p = 2
    while p * p <= a:
        if a % p == 0:
            cnt = 0
            while a % p == 0:
                cnt += 1
                a //= p
            primes[p] = max(primes[p], cnt)
        p += 1
    if a != 1:
        if a not in primes:
            primes[a] = 1
lcm = 1
for p in primes:
    lcm = lcm * pow(p, primes[p], MOD) % MOD
ans = 0
for a in A:
    ans += lcm * pow(a, MOD - 2, MOD) % MOD
    ans %= MOD
print(ans)

-from functools import reduce -from fractions import gcd - +from collections import defaultdict + -lcm = reduce(lambda x, y: x * (y // gcd(x, y)), A) -lcm %= MOD -coef = sum(pow(a, MOD - 2, MOD) for a in A) -ans = lcm * coef % MOD +primes = defaultdict(int) +for a in A: +    p = 2 +    while p * p <= a: +        if a % p == 0: +            cnt = 0 +            while a % p == 0: +                cnt += 1 +                a //= p +            primes[p] = max(primes[p], cnt) +        p += 1 +    if a != 1: +        if a not in primes: +            primes[a] = 1 +lcm = 1 +for p in primes: +    lcm = lcm * pow(p, primes[p], MOD) % MOD +ans = 0 +for a in A: +    ans += lcm * pow(a, MOD - 2, MOD) % MOD +    ans %= MOD