import collections

import sys



input = sys.stdin.readline



ri = lambda: int(eval(input()))

rs = lambda: input().rstrip()

ril = lambda: list(map(int, input().split()))

rsl = lambda: input().rstrip().split()

ris = lambda n: [ri() for _ in range(n)]

rss = lambda n: [rs() for _ in range(n)]

rils = lambda n: [ril() for _ in range(n)]

rsls = lambda n: [rsl() for _ in range(n)]





def factorize_all(n):

    factorizations = [None] * (n + 1)

    factorizations[0] = dict()

    factorizations[1] = dict()

    for p in range(2, n + 1):

        if factorizations[p] is None:

            for k in range(1, n // p + 1):

                if factorizations[k] is None:

                    continue

                fs = factorizations[k].copy()

                if p in fs:

                    fs[p] += 1

                else:

                    fs[p] = 1

                factorizations[k * p] = fs

    return factorizations





MOD = 10**9 + 7



n = ri()

ls = ril()

if n == 1:

    print((1))

    exit()



factorizations = factorize_all(max(ls))



lcm = collections.Counter()

for x in ls:

    counter = factorizations[x]

    for p, k in list(counter.items()):

        lcm[p] = max(lcm[p], k)

lcm_val = 1

for p, k in list(lcm.items()):

    lcm_val *= pow(p, k, MOD)

    lcm_val %= MOD



res = 0

for x in ls:

    res += lcm_val * pow(x, MOD - 2, MOD)

    res %= MOD

print(res)
import collections

import sys



input = sys.stdin.readline



ri = lambda: int(eval(input()))

rs = lambda: input().rstrip()

ril = lambda: list(map(int, input().split()))

rsl = lambda: input().rstrip().split()

ris = lambda n: [ri() for _ in range(n)]

rss = lambda n: [rs() for _ in range(n)]

rils = lambda n: [ril() for _ in range(n)]

rsls = lambda n: [rsl() for _ in range(n)]





def eratosthenes(n):

    sieve = [True for _ in range(n + 1)]

    sieve[0] = False

    sieve[1] = False



    def _update(p):

        if sieve[p]:

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

                sieve[i] = False



    if n > 1:

        _update(2)

    p = 3

    while p * p <= n:

        _update(p)

        p += 2

    return sieve





def factorize(n, primes):

    import collections

    if n < 2:

        return dict()

    counter = collections.Counter()

    for p in primes:

        while n % p == 0:

            counter[p] += 1

            n //= p

        if n == 1:

            break

    if n > 1:

        counter[n] += 1

    return counter





MOD = 10**9 + 7



n = ri()

ls = ril()

if n == 1:

    print((1))

    exit()



sieve = eratosthenes(10**3)

primes = [x for x, b in enumerate(sieve) if b]



lcm = collections.Counter()

for x in ls:

    counter = factorize(x, primes)

    for p, k in list(counter.items()):

        lcm[p] = max(lcm[p], k)

lcm_val = 1

for p, k in list(lcm.items()):

    lcm_val *= pow(p, k, MOD)

    lcm_val %= MOD



res = 0

for x in ls:

    res += lcm_val * pow(x, MOD - 2, MOD)

    res %= MOD

print(res)
import collections
import sys

input = sys.stdin.readline
ri = lambda: int(eval(input()))
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]


def factorize_all(n):
    factorizations = [None] * (n + 1)
    factorizations[0] = dict()
    factorizations[1] = dict()
    for p in range(2, n + 1):
        if factorizations[p] is None:
            for k in range(1, n // p + 1):
                if factorizations[k] is None:
                    continue
                fs = factorizations[k].copy()
                if p in fs:
                    fs[p] += 1
                else:
                    fs[p] = 1
                factorizations[k * p] = fs
    return factorizations


MOD = 10**9 + 7
n = ri()
ls = ril()
if n == 1:
    print((1))
    exit()
factorizations = factorize_all(max(ls))
lcm = collections.Counter()
for x in ls:
    counter = factorizations[x]
    for p, k in list(counter.items()):
        lcm[p] = max(lcm[p], k)
lcm_val = 1
for p, k in list(lcm.items()):
    lcm_val *= pow(p, k, MOD)
    lcm_val %= MOD
res = 0
for x in ls:
    res += lcm_val * pow(x, MOD - 2, MOD)
    res %= MOD
print(res)

import collections
import sys

input = sys.stdin.readline
ri = lambda: int(eval(input()))
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    if n > 1:
        _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


def factorize(n, primes):
    import collections

    if n < 2:
        return dict()
    counter = collections.Counter()
    for p in primes:
        while n % p == 0:
            counter[p] += 1
            n //= p
        if n == 1:
            break
    if n > 1:
        counter[n] += 1
    return counter


MOD = 10**9 + 7
n = ri()
ls = ril()
if n == 1:
    print((1))
    exit()
sieve = eratosthenes(10**3)
primes = [x for x, b in enumerate(sieve) if b]
lcm = collections.Counter()
for x in ls:
    counter = factorize(x, primes)
    for p, k in list(counter.items()):
        lcm[p] = max(lcm[p], k)
lcm_val = 1
for p, k in list(lcm.items()):
    lcm_val *= pow(p, k, MOD)
    lcm_val %= MOD
res = 0
for x in ls:
    res += lcm_val * pow(x, MOD - 2, MOD)
    res %= MOD
print(res)

-def factorize_all(n): -    factorizations = [None] * (n + 1) -    factorizations[0] = dict() -    factorizations[1] = dict() -    for p in range(2, n + 1): -        if factorizations[p] is None: -            for k in range(1, n // p + 1): -                if factorizations[k] is None: -                    continue -                fs = factorizations[k].copy() -                if p in fs: -                    fs[p] += 1 -                else: -                    fs[p] = 1 -                factorizations[k * p] = fs -    return factorizations +def eratosthenes(n): +    sieve = [True for _ in range(n + 1)] +    sieve[0] = False +    sieve[1] = False + +    def _update(p): +        if sieve[p]: +            for i in range(p * 2, n + 1, p): +                sieve[i] = False + +    if n > 1: +        _update(2) +    p = 3 +    while p * p <= n: +        _update(p) +        p += 2 +    return sieve + + +def factorize(n, primes): +    import collections + +    if n < 2: +        return dict() +    counter = collections.Counter() +    for p in primes: +        while n % p == 0: +            counter[p] += 1 +            n //= p +        if n == 1: +            break +    if n > 1: +        counter[n] += 1 +    return counter -factorizations = factorize_all(max(ls)) +sieve = eratosthenes(10**3) +primes = [x for x, b in enumerate(sieve) if b] -    counter = factorizations[x] +    counter = factorize(x, primes)