"""

最小公倍数LCMを求めて、LCMを各Aで除した商を合計すればよい

"""

from math import gcd

def lcm(a,b):

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

def main():

    mod = 10**9 +7

    N = int(eval(input()))

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

    l = A[0]

    for i in range(1,N):

        l = lcm(l,A[i])



    ans = 0

    for a in A:

        ans += l//a

    print((ans%mod))

main()
from collections import Counter

N = int(eval(input()))

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

memo = []

for i in range(N):

    tmp = []

    a = A[i]

    d = 2

    while d*d <= a:

        while a%d == 0:

            tmp.append(d)

            a //= d

        d += 1

    if a!=1:

        tmp.append(a)

    memo.append(Counter(tmp))



lcm = Counter([])



for count in memo:

    for k,v in list(count.items()):

        if k not in lcm:

            lcm[k] = v

        else:

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

mod = 10**9 +7

LCM = 1

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

    LCM = LCM*pow(k,v)%mod



ans = 0

for a in A:

    ans = (ans + LCM*pow(a,mod-2,mod))%mod

print((int(ans)))
"""
最小公倍数LCMを求めて、LCMを各Aで除した商を合計すればよい
"""
from math import gcd


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


def main():
    mod = 10**9 + 7
    N = int(eval(input()))
    A = list(map(int, input().split()))
    l = A[0]
    for i in range(1, N):
        l = lcm(l, A[i])
    ans = 0
    for a in A:
        ans += l // a
    print((ans % mod))


main()

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
memo = []
for i in range(N):
    tmp = []
    a = A[i]
    d = 2
    while d * d <= a:
        while a % d == 0:
            tmp.append(d)
            a //= d
        d += 1
    if a != 1:
        tmp.append(a)
    memo.append(Counter(tmp))
lcm = Counter([])
for count in memo:
    for k, v in list(count.items()):
        if k not in lcm:
            lcm[k] = v
        else:
            lcm[k] = max(lcm[k], v)
mod = 10**9 + 7
LCM = 1
for k, v in list(lcm.items()):
    LCM = LCM * pow(k, v) % mod
ans = 0
for a in A:
    ans = (ans + LCM * pow(a, mod - 2, mod)) % mod
print((int(ans)))

-""" -最小公倍数LCMを求めて、LCMを各Aで除した商を合計すればよい -""" -from math import gcd +from collections import Counter - -def lcm(a, b): -    return a * b // gcd(a, b) - - -def main(): -    mod = 10**9 + 7 -    N = int(eval(input())) -    A = list(map(int, input().split())) -    l = A[0] -    for i in range(1, N): -        l = lcm(l, A[i]) -    ans = 0 -    for a in A: -        ans += l // a -    print((ans % mod)) - - -main() +N = int(eval(input())) +A = list(map(int, input().split())) +memo = [] +for i in range(N): +    tmp = [] +    a = A[i] +    d = 2 +    while d * d <= a: +        while a % d == 0: +            tmp.append(d) +            a //= d +        d += 1 +    if a != 1: +        tmp.append(a) +    memo.append(Counter(tmp)) +lcm = Counter([]) +for count in memo: +    for k, v in list(count.items()): +        if k not in lcm: +            lcm[k] = v +        else: +            lcm[k] = max(lcm[k], v) +mod = 10**9 + 7 +LCM = 1 +for k, v in list(lcm.items()): +    LCM = LCM * pow(k, v) % mod +ans = 0 +for a in A: +    ans = (ans + LCM * pow(a, mod - 2, mod)) % mod +print((int(ans)))