from functools import reduce
def main():

    from functools import reduce



    def gcd(a, b):

        return a if b == 0 else gcd(b, a % b)



    def lcm(a, b):

        return a * b // gcd(a, b)



    mod = 10 ** 9 + 7



    n = int(eval(input()))

    *a, = list(map(int, input().split()))



    L = reduce(lcm, a)



    ret = 0

    for x in a:

        ret = (ret + pow(x, mod - 2, mod)) % mod

    ret = ret * L % mod

    print(ret)





if __name__ == '__main__':

    main()

# 解説放送を見た



class Sieve:

    """区間[2,n]の値を素因数分解する"""



    def __init__(self, n=1):

        primes = []

        f = [0] * (n + 1)

        f[0] = f[1] = -1

        for i in range(2, n + 1):  # 素数を探す

            if f[i]: continue

            primes.append(i)

            f[i] = i  # 素数には自身を代入

            for j in range(i * i, n + 1, i):  # 合成数に素因数を書き込む

                if not f[j]:

                    f[j] = i  # 最小の素因数を代入

        self.primes = primes

        self.f = f



    def is_prime(self, x) -> bool:  # 素数判定

        return self.f[x] == x



    def factor_list(self, x) -> list:  # 素因数分解の昇順リスト, [2,2,3,5,...]

        res = []

        while x != 1:

            res.append(self.f[x])

            x //= self.f[x]

        return res



    def factor(self, x) -> list:  # 素因数分解の頻度リスト, [[2,x],[3,y],[5,z],...]

        fl = self.factor_list(x)

        if not fl: return []

        res = [[fl[0], 0]]

        for p in fl:

            if res[-1][0] == p:

                res[-1][1] += 1

            else:

                res.append([p, 1])

        return res





def main():

    from collections import defaultdict



    mod = 10 ** 9 + 7



    _ = int(eval(input()))  # n

    *a, = list(map(int, input().split()))



    sieve = Sieve(n=10 ** 6 + 5)



    mp = defaultdict(int)

    for x in a:

        f = sieve.factor(x=x)  # [[prime,cnt],...]

        for prime, cnt in f:

            mp[prime] = max(mp[prime], cnt)



    lcm = 1

    for prime, cnt in list(mp.items()):

        for _ in range(cnt):

            lcm = (lcm * prime) % mod



    ans = 0

    for x in a:

        b = lcm * pow(x, mod - 2, mod) % mod

        ans = (ans + b) % mod

    print(ans)





if __name__ == '__main__':

    main()

from functools import reduce


def main():
    from functools import reduce

    def gcd(a, b):
        return a if b == 0 else gcd(b, a % b)

    def lcm(a, b):
        return a * b // gcd(a, b)

    mod = 10**9 + 7
    n = int(eval(input()))
    (*a,) = list(map(int, input().split()))
    L = reduce(lcm, a)
    ret = 0
    for x in a:
        ret = (ret + pow(x, mod - 2, mod)) % mod
    ret = ret * L % mod
    print(ret)


if __name__ == "__main__":
    main()

# 解説放送を見た
class Sieve:
    """区間[2,n]の値を素因数分解する"""

    def __init__(self, n=1):
        primes = []
        f = [0] * (n + 1)
        f[0] = f[1] = -1
        for i in range(2, n + 1):  # 素数を探す
            if f[i]:
                continue
            primes.append(i)
            f[i] = i  # 素数には自身を代入
            for j in range(i * i, n + 1, i):  # 合成数に素因数を書き込む
                if not f[j]:
                    f[j] = i  # 最小の素因数を代入
        self.primes = primes
        self.f = f

    def is_prime(self, x) -> bool:  # 素数判定
        return self.f[x] == x

    def factor_list(self, x) -> list:  # 素因数分解の昇順リスト, [2,2,3,5,...]
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res

    def factor(self, x) -> list:  # 素因数分解の頻度リスト, [[2,x],[3,y],[5,z],...]
        fl = self.factor_list(x)
        if not fl:
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res


def main():
    from collections import defaultdict

    mod = 10**9 + 7
    _ = int(eval(input()))  # n
    (*a,) = list(map(int, input().split()))
    sieve = Sieve(n=10**6 + 5)
    mp = defaultdict(int)
    for x in a:
        f = sieve.factor(x=x)  # [[prime,cnt],...]
        for prime, cnt in f:
            mp[prime] = max(mp[prime], cnt)
    lcm = 1
    for prime, cnt in list(mp.items()):
        for _ in range(cnt):
            lcm = (lcm * prime) % mod
    ans = 0
    for x in a:
        b = lcm * pow(x, mod - 2, mod) % mod
        ans = (ans + b) % mod
    print(ans)


if __name__ == "__main__":
    main()

-from functools import reduce +# 解説放送を見た +class Sieve: +    """区間[2,n]の値を素因数分解する""" + +    def __init__(self, n=1): +        primes = [] +        f = [0] * (n + 1) +        f[0] = f[1] = -1 +        for i in range(2, n + 1):  # 素数を探す +            if f[i]: +                continue +            primes.append(i) +            f[i] = i  # 素数には自身を代入 +            for j in range(i * i, n + 1, i):  # 合成数に素因数を書き込む +                if not f[j]: +                    f[j] = i  # 最小の素因数を代入 +        self.primes = primes +        self.f = f + +    def is_prime(self, x) -> bool:  # 素数判定 +        return self.f[x] == x + +    def factor_list(self, x) -> list:  # 素因数分解の昇順リスト, [2,2,3,5,...] +        res = [] +        while x != 1: +            res.append(self.f[x]) +            x //= self.f[x] +        return res + +    def factor(self, x) -> list:  # 素因数分解の頻度リスト, [[2,x],[3,y],[5,z],...] +        fl = self.factor_list(x) +        if not fl: +            return [] +        res = [[fl[0], 0]] +        for p in fl: +            if res[-1][0] == p: +                res[-1][1] += 1 +            else: +                res.append([p, 1]) +        return res -    from functools import reduce - -    def gcd(a, b): -        return a if b == 0 else gcd(b, a % b) - -    def lcm(a, b): -        return a * b // gcd(a, b) +    from collections import defaultdict -    n = int(eval(input())) +    _ = int(eval(input()))  # n -    L = reduce(lcm, a) -    ret = 0 +    sieve = Sieve(n=10**6 + 5) +    mp = defaultdict(int) -        ret = (ret + pow(x, mod - 2, mod)) % mod -    ret = ret * L % mod -    print(ret) +        f = sieve.factor(x=x)  # [[prime,cnt],...] +        for prime, cnt in f: +            mp[prime] = max(mp[prime], cnt) +    lcm = 1 +    for prime, cnt in list(mp.items()): +        for _ in range(cnt): +            lcm = (lcm * prime) % mod +    ans = 0 +    for x in a: +        b = lcm * pow(x, mod - 2, mod) % mod +        ans = (ans + b) % mod +    print(ans)