import sys

from collections import Counter, defaultdict



read = sys.stdin.read





# 最小素因数を求める（エラトステネスの篩の亜種？）

def min_factor(n):

    sieve = list(range(n + 1))

    sieve[2::2] = [2] * (n // 2)

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

        if sieve[i] == i:

            sieve[i * i::2 * i] = [i] * ((n - i * i - 1) // (2 * i) + 1)

    return sieve





# 素因数分解

def prime_factorize(n):

    a = [1]

    while n != 1:

        b = table[n]

        a.append(b)

        n //= b

    return a





N, *A = list(map(int, read().split()))

mod = 10 ** 9 + 7



table = min_factor(10 ** 6)

dic = defaultdict(int)



for i in A:

    for key, value in list(Counter(prime_factorize(i)).items()):

        dic[key] = max(dic[key], value)





lcm = 1

for i, j in list(dic.items()):

    lcm *= pow(i, j, mod)

    lcm %= mod



answer = sum(lcm * pow(i, mod - 2, mod) for i in A) % mod

print(answer)

import sys

from collections import defaultdict



read = sys.stdin.read





# 最小素因数を求める（エラトステネスの篩の亜種？）

def min_factor(n):

    sieve = list(range(n + 1))

    sieve[2::2] = [2] * (n // 2)

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

        if sieve[i] == i:

            sieve[i * i::2 * i] = [i] * ((n - i * i - 1) // (2 * i) + 1)

    return sieve





# 素因数分解

def prime_factorize(n):

    a = defaultdict(int)

    while n != 1:

        b = table[n]

        a[b] += 1

        n //= b

    return a





N, *A = list(map(int, read().split()))

mod = 10 ** 9 + 7



table = min_factor(10 ** 6)

dic = defaultdict(int)



for i in A:

    for key, value in list(prime_factorize(i).items()):

        dic[key] = max(dic[key], value)





lcm = 1

for i, j in list(dic.items()):

    lcm *= pow(i, j, mod)

    lcm %= mod



answer = sum(lcm * pow(i, mod - 2, mod) for i in A) % mod

print(answer)

import sys
from collections import Counter, defaultdict

read = sys.stdin.read
# 最小素因数を求める（エラトステネスの篩の亜種？）
def min_factor(n):
    sieve = list(range(n + 1))
    sieve[2::2] = [2] * (n // 2)
    for i in range(3, int(n**0.5) + 2, 2):
        if sieve[i] == i:
            sieve[i * i :: 2 * i] = [i] * ((n - i * i - 1) // (2 * i) + 1)
    return sieve


# 素因数分解
def prime_factorize(n):
    a = [1]
    while n != 1:
        b = table[n]
        a.append(b)
        n //= b
    return a


N, *A = list(map(int, read().split()))
mod = 10**9 + 7
table = min_factor(10**6)
dic = defaultdict(int)
for i in A:
    for key, value in list(Counter(prime_factorize(i)).items()):
        dic[key] = max(dic[key], value)
lcm = 1
for i, j in list(dic.items()):
    lcm *= pow(i, j, mod)
    lcm %= mod
answer = sum(lcm * pow(i, mod - 2, mod) for i in A) % mod
print(answer)

import sys
from collections import defaultdict

read = sys.stdin.read
# 最小素因数を求める（エラトステネスの篩の亜種？）
def min_factor(n):
    sieve = list(range(n + 1))
    sieve[2::2] = [2] * (n // 2)
    for i in range(3, int(n**0.5) + 2, 2):
        if sieve[i] == i:
            sieve[i * i :: 2 * i] = [i] * ((n - i * i - 1) // (2 * i) + 1)
    return sieve


# 素因数分解
def prime_factorize(n):
    a = defaultdict(int)
    while n != 1:
        b = table[n]
        a[b] += 1
        n //= b
    return a


N, *A = list(map(int, read().split()))
mod = 10**9 + 7
table = min_factor(10**6)
dic = defaultdict(int)
for i in A:
    for key, value in list(prime_factorize(i).items()):
        dic[key] = max(dic[key], value)
lcm = 1
for i, j in list(dic.items()):
    lcm *= pow(i, j, mod)
    lcm %= mod
answer = sum(lcm * pow(i, mod - 2, mod) for i in A) % mod
print(answer)

-from collections import Counter, defaultdict +from collections import defaultdict -    a = [1] +    a = defaultdict(int) -        a.append(b) +        a[b] += 1 -    for key, value in list(Counter(prime_factorize(i)).items()): +    for key, value in list(prime_factorize(i).items()):