from collections import defaultdict

N=int(eval(input()))

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



MOD=10**9+7



LCM=defaultdict(int)

def f(n):

    ret=defaultdict(int)

    p=2

    while n%p==0:

        ret[p]+=1

        n//=p

    LCM[p]=max(LCM[p],ret[p])

    p=3

    while p*p<=n:

        while n%p==0:

            ret[p]+=1

            n//=p

        LCM[p]=max(LCM[p],ret[p])

        p+=2

    if n>1:

        ret[n]=1

        LCM[n]=max(LCM[n],ret[n])

    return ret



F=[]

for a in A:

    F.append(f(a))



l=1

for p,n in list(LCM.items()):

    l=l*pow(p,n,MOD)%MOD



ans=0

for a in A:

    ans+=l*pow(a,MOD-2,MOD)

    ans%=MOD



print(ans)
from collections import defaultdict

N=int(eval(input()))

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



MOD=10**9+7



LCM=defaultdict(int)

def f(n):

    tmp=0

    p=2

    while n%p==0:

        tmp+=1

        n//=p

    LCM[p]=max(LCM[p],tmp)

    p=3

    while p*p<=n:

        tmp=0

        while n%p==0:

            tmp+=1

            n//=p

        LCM[p]=max(LCM[p],tmp)

        p+=2

    if n>1:

        LCM[n]=max(LCM[n],1)



for a in A: f(a)



l=1

for p,n in list(LCM.items()):

    l=l*pow(p,n,MOD)%MOD



ans=0

for a in A:

    ans+=l*pow(a,MOD-2,MOD)

    ans%=MOD



print(ans)
from collections import defaultdict

N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
LCM = defaultdict(int)


def f(n):
    ret = defaultdict(int)
    p = 2
    while n % p == 0:
        ret[p] += 1
        n //= p
    LCM[p] = max(LCM[p], ret[p])
    p = 3
    while p * p <= n:
        while n % p == 0:
            ret[p] += 1
            n //= p
        LCM[p] = max(LCM[p], ret[p])
        p += 2
    if n > 1:
        ret[n] = 1
        LCM[n] = max(LCM[n], ret[n])
    return ret


F = []
for a in A:
    F.append(f(a))
l = 1
for p, n in list(LCM.items()):
    l = l * pow(p, n, MOD) % MOD
ans = 0
for a in A:
    ans += l * pow(a, MOD - 2, MOD)
    ans %= MOD
print(ans)

from collections import defaultdict

N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 10**9 + 7
LCM = defaultdict(int)


def f(n):
    tmp = 0
    p = 2
    while n % p == 0:
        tmp += 1
        n //= p
    LCM[p] = max(LCM[p], tmp)
    p = 3
    while p * p <= n:
        tmp = 0
        while n % p == 0:
            tmp += 1
            n //= p
        LCM[p] = max(LCM[p], tmp)
        p += 2
    if n > 1:
        LCM[n] = max(LCM[n], 1)


for a in A:
    f(a)
l = 1
for p, n in list(LCM.items()):
    l = l * pow(p, n, MOD) % MOD
ans = 0
for a in A:
    ans += l * pow(a, MOD - 2, MOD)
    ans %= MOD
print(ans)

-    ret = defaultdict(int) +    tmp = 0 -        ret[p] += 1 +        tmp += 1 -    LCM[p] = max(LCM[p], ret[p]) +    LCM[p] = max(LCM[p], tmp) +        tmp = 0 -            ret[p] += 1 +            tmp += 1 -        LCM[p] = max(LCM[p], ret[p]) +        LCM[p] = max(LCM[p], tmp) -        ret[n] = 1 -        LCM[n] = max(LCM[n], ret[n]) -    return ret +        LCM[n] = max(LCM[n], 1) -F = [] -    F.append(f(a)) +    f(a)