# エラトステネスの篩, フェルマーの小定理

def make_prime_table(N):

    sieve = list(range(N + 1))

    sieve[0] = -1

    sieve[1] = -1

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

        if sieve[i] != i:

            continue

        for j in range(i * i, N + 1, i):

            if sieve[j] == j:

                sieve[j] = i

    return sieve





N = int(eval(input()))

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



m = 1000000007



prime_table = make_prime_table(1000000)



lcm_factors = {}

for i in range(N):

    t = []

    a = A[i]

    while a != 1:

        if len(t) != 0 and t[-1][0] == prime_table[a]:

            t[-1][1] += 1

        else:

            t.append([prime_table[a], 1])

        a //= prime_table[a]

    for k, v in t:

        if k not in lcm_factors or lcm_factors[k] < v:

            lcm_factors[k] = v



lcm = 1

for k in lcm_factors:

    for i in range(lcm_factors[k]):

        lcm *= k

        lcm %= m



result = 0

for i in range(N):

    result += lcm * pow(A[i], m - 2, m)

    result %= m

print(result)

# エラトステネスの篩, フェルマーの小定理

def make_prime_table(n):

    sieve = list(range(n + 1))

    sieve[0] = -1

    sieve[1] = -1

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

        if sieve[i] != i:

            continue

        for j in range(i * i, n + 1, i):

            if sieve[j] == j:

                sieve[j] = i

    return sieve





def prime_factorize(n):

    result = []

    while n != 1:

        p = prime_table[n]

        c = 0

        while n % p == 0:

            n //= p

            c += 1

        result.append((p, c))

    return result





N = int(eval(input()))

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



m = 1000000007



prime_table = make_prime_table(10 ** 6)



lcm_factors = {}

for a in A:

    for p, c in prime_factorize(a):

        if p not in lcm_factors or lcm_factors[p] < c:

            lcm_factors[p] = c



lcm = 1

for p in lcm_factors:

    lcm *= pow(p, lcm_factors[p], m)

    lcm %= m



result = 0

for i in range(N):

    result += lcm * pow(A[i], m - 2, m)

    result %= m

print(result)

# エラトステネスの篩, フェルマーの小定理
def make_prime_table(N):
    sieve = list(range(N + 1))
    sieve[0] = -1
    sieve[1] = -1
    for i in range(2, int(N**0.5) + 1):
        if sieve[i] != i:
            continue
        for j in range(i * i, N + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve


N = int(eval(input()))
A = list(map(int, input().split()))
m = 1000000007
prime_table = make_prime_table(1000000)
lcm_factors = {}
for i in range(N):
    t = []
    a = A[i]
    while a != 1:
        if len(t) != 0 and t[-1][0] == prime_table[a]:
            t[-1][1] += 1
        else:
            t.append([prime_table[a], 1])
        a //= prime_table[a]
    for k, v in t:
        if k not in lcm_factors or lcm_factors[k] < v:
            lcm_factors[k] = v
lcm = 1
for k in lcm_factors:
    for i in range(lcm_factors[k]):
        lcm *= k
        lcm %= m
result = 0
for i in range(N):
    result += lcm * pow(A[i], m - 2, m)
    result %= m
print(result)

# エラトステネスの篩, フェルマーの小定理
def make_prime_table(n):
    sieve = list(range(n + 1))
    sieve[0] = -1
    sieve[1] = -1
    for i in range(2, int(n**0.5) + 1):
        if sieve[i] != i:
            continue
        for j in range(i * i, n + 1, i):
            if sieve[j] == j:
                sieve[j] = i
    return sieve


def prime_factorize(n):
    result = []
    while n != 1:
        p = prime_table[n]
        c = 0
        while n % p == 0:
            n //= p
            c += 1
        result.append((p, c))
    return result


N = int(eval(input()))
A = list(map(int, input().split()))
m = 1000000007
prime_table = make_prime_table(10**6)
lcm_factors = {}
for a in A:
    for p, c in prime_factorize(a):
        if p not in lcm_factors or lcm_factors[p] < c:
            lcm_factors[p] = c
lcm = 1
for p in lcm_factors:
    lcm *= pow(p, lcm_factors[p], m)
    lcm %= m
result = 0
for i in range(N):
    result += lcm * pow(A[i], m - 2, m)
    result %= m
print(result)

-def make_prime_table(N): -    sieve = list(range(N + 1)) +def make_prime_table(n): +    sieve = list(range(n + 1)) -    for i in range(2, int(N**0.5) + 1): +    for i in range(2, int(n**0.5) + 1): -        for j in range(i * i, N + 1, i): +        for j in range(i * i, n + 1, i): +def prime_factorize(n): +    result = [] +    while n != 1: +        p = prime_table[n] +        c = 0 +        while n % p == 0: +            n //= p +            c += 1 +        result.append((p, c)) +    return result + + -prime_table = make_prime_table(1000000) +prime_table = make_prime_table(10**6) -for i in range(N): -    t = [] -    a = A[i] -    while a != 1: -        if len(t) != 0 and t[-1][0] == prime_table[a]: -            t[-1][1] += 1 -        else: -            t.append([prime_table[a], 1]) -        a //= prime_table[a] -    for k, v in t: -        if k not in lcm_factors or lcm_factors[k] < v: -            lcm_factors[k] = v +for a in A: +    for p, c in prime_factorize(a): +        if p not in lcm_factors or lcm_factors[p] < c: +            lcm_factors[p] = c -for k in lcm_factors: -    for i in range(lcm_factors[k]): -        lcm *= k -        lcm %= m +for p in lcm_factors: +    lcm *= pow(p, lcm_factors[p], m) +    lcm %= m