import sys

input = sys.stdin.readline

from collections import defaultdict





class PrimeFactor():



    def __init__(self, n):                  # エラトステネス　O(N loglog N)

        self.n = n

        self.table = list(range(n+1))

        self.table[2::2] = [2]*(n//2)

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

            if self.table[p] == p:

                self.table[p * p::2 * p] = [p] * ((n - p * p - 1) // (2 * p) + 1)



    def is_prime(self, x):  # 素数判定　O(1)

        if x < 2:

            return False

        return self.table[x] == x



    def prime_factors(self, x):             # 素因数分解 O(logN)

        res = []

        if x < 2:

            return res

        while self.table[x] != 1:

            res.append(self.table[x])

            x //= self.table[x]

        return res



    def prime_counter(self, x):             # 素因数分解（個数のリスト）

        res = defaultdict(int)

        if x < 2:

            return res

        while self.table[x] != 1:

            res[self.table[x]] += 1

            x //= self.table[x]

        return res



    def prime_gcd(self, X):                 # n個の最大公約数　X:n個のリスト

        exponents = self.prime_counter(X[0])

        for x in X[1:]:

            Y = self.prime_counter(x)

            for prime, exp in list(exponents.items()):

                if Y[prime] < exp:

                    exponents[prime] = Y[prime]

        res = 1

        for prime, exp in list(exponents.items()):

            res *= pow(prime, exp)

        return res



    def prime_lcm(self, X, mod=None):       # n個の最小公倍数　X:n個のリスト

        exponents = defaultdict(int)

        for x in X:

            for prime, exp in list(self.prime_counter(x).items()):

                if exp > exponents[prime]:

                    exponents[prime] = exp

        res = 1

        for prime, exp in list(exponents.items()):

            res *= pow(prime, exp, mod)

        if mod == None:

            return res

        else:

            return res % mod



mod = 10 ** 9 + 7



N = int(eval(input()))

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

table = PrimeFactor(10**6)

num = table.prime_lcm(A,mod)



res = 0

for a in A:

    res += num * pow(a, mod - 2, mod)



print((res % mod))
# https://atcoder.jp/contests/abc152/submissions/9693323



import sys

read = sys.stdin.read



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

mod = 10 ** 9 + 7





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) // (2 * i) + 1)

    return sieve





def prime_factorize(n):

    a = {}

    while n != 1:

        b = table[n]

        if b in a:

            a[b] += 1

        else:

            a[b] = 1

        n //= b

    return a





table = min_factor(10**6)



dic = {}

for i in A:

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

        if key in dic:

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

        else:

            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

input = sys.stdin.readline
from collections import defaultdict


class PrimeFactor:
    def __init__(self, n):  # エラトステネス　O(N loglog N)
        self.n = n
        self.table = list(range(n + 1))
        self.table[2::2] = [2] * (n // 2)
        for p in range(3, int(n**0.5) + 2, 2):
            if self.table[p] == p:
                self.table[p * p :: 2 * p] = [p] * ((n - p * p - 1) // (2 * p) + 1)

    def is_prime(self, x):  # 素数判定　O(1)
        if x < 2:
            return False
        return self.table[x] == x

    def prime_factors(self, x):  # 素因数分解 O(logN)
        res = []
        if x < 2:
            return res
        while self.table[x] != 1:
            res.append(self.table[x])
            x //= self.table[x]
        return res

    def prime_counter(self, x):  # 素因数分解（個数のリスト）
        res = defaultdict(int)
        if x < 2:
            return res
        while self.table[x] != 1:
            res[self.table[x]] += 1
            x //= self.table[x]
        return res

    def prime_gcd(self, X):  # n個の最大公約数　X:n個のリスト
        exponents = self.prime_counter(X[0])
        for x in X[1:]:
            Y = self.prime_counter(x)
            for prime, exp in list(exponents.items()):
                if Y[prime] < exp:
                    exponents[prime] = Y[prime]
        res = 1
        for prime, exp in list(exponents.items()):
            res *= pow(prime, exp)
        return res

    def prime_lcm(self, X, mod=None):  # n個の最小公倍数　X:n個のリスト
        exponents = defaultdict(int)
        for x in X:
            for prime, exp in list(self.prime_counter(x).items()):
                if exp > exponents[prime]:
                    exponents[prime] = exp
        res = 1
        for prime, exp in list(exponents.items()):
            res *= pow(prime, exp, mod)
        if mod == None:
            return res
        else:
            return res % mod


mod = 10**9 + 7
N = int(eval(input()))
A = list(map(int, input().split()))
table = PrimeFactor(10**6)
num = table.prime_lcm(A, mod)
res = 0
for a in A:
    res += num * pow(a, mod - 2, mod)
print((res % mod))

# https://atcoder.jp/contests/abc152/submissions/9693323
import sys

read = sys.stdin.read
N, *A = list(map(int, read().split()))
mod = 10**9 + 7


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) // (2 * i) + 1)
    return sieve


def prime_factorize(n):
    a = {}
    while n != 1:
        b = table[n]
        if b in a:
            a[b] += 1
        else:
            a[b] = 1
        n //= b
    return a


table = min_factor(10**6)
dic = {}
for i in A:
    for key, value in list(prime_factorize(i).items()):
        if key in dic:
            dic[key] = max(dic[key], value)
        else:
            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)

+# https://atcoder.jp/contests/abc152/submissions/9693323 -input = sys.stdin.readline -from collections import defaultdict +read = sys.stdin.read +N, *A = list(map(int, read().split())) +mod = 10**9 + 7 -class PrimeFactor: -    def __init__(self, n):  # エラトステネス　O(N loglog N) -        self.n = n -        self.table = list(range(n + 1)) -        self.table[2::2] = [2] * (n // 2) -        for p in range(3, int(n**0.5) + 2, 2): -            if self.table[p] == p: -                self.table[p * p :: 2 * p] = [p] * ((n - p * p - 1) // (2 * p) + 1) - -    def is_prime(self, x):  # 素数判定　O(1) -        if x < 2: -            return False -        return self.table[x] == x - -    def prime_factors(self, x):  # 素因数分解 O(logN) -        res = [] -        if x < 2: -            return res -        while self.table[x] != 1: -            res.append(self.table[x]) -            x //= self.table[x] -        return res - -    def prime_counter(self, x):  # 素因数分解（個数のリスト） -        res = defaultdict(int) -        if x < 2: -            return res -        while self.table[x] != 1: -            res[self.table[x]] += 1 -            x //= self.table[x] -        return res - -    def prime_gcd(self, X):  # n個の最大公約数　X:n個のリスト -        exponents = self.prime_counter(X[0]) -        for x in X[1:]: -            Y = self.prime_counter(x) -            for prime, exp in list(exponents.items()): -                if Y[prime] < exp: -                    exponents[prime] = Y[prime] -        res = 1 -        for prime, exp in list(exponents.items()): -            res *= pow(prime, exp) -        return res - -    def prime_lcm(self, X, mod=None):  # n個の最小公倍数　X:n個のリスト -        exponents = defaultdict(int) -        for x in X: -            for prime, exp in list(self.prime_counter(x).items()): -                if exp > exponents[prime]: -                    exponents[prime] = exp -        res = 1 -        for prime, exp in list(exponents.items()): -            res *= pow(prime, exp, mod) -        if mod == None: -            return res -        else: -            return res % mod +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) // (2 * i) + 1) +    return sieve -mod = 10**9 + 7 -N = int(eval(input())) -A = list(map(int, input().split())) -table = PrimeFactor(10**6) -num = table.prime_lcm(A, mod) -res = 0 -for a in A: -    res += num * pow(a, mod - 2, mod) -print((res % mod)) +def prime_factorize(n): +    a = {} +    while n != 1: +        b = table[n] +        if b in a: +            a[b] += 1 +        else: +            a[b] = 1 +        n //= b +    return a + + +table = min_factor(10**6) +dic = {} +for i in A: +    for key, value in list(prime_factorize(i).items()): +        if key in dic: +            dic[key] = max(dic[key], value) +        else: +            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)