from fractions import gcd

N=int(eval(input()))

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

mod=10**9+7

M=1

for a in A:

    M=((M * a) // gcd(M, a))

M%=mod



count=0



for a in A:

    count=(count+M*pow(a,mod-2,mod))%mod

print(count)

from collections import *

from itertools import *

from bisect import *

from heapq import *

import copy

import math

from fractions import gcd

def factorization(n):

    arr = []

    temp = n

    for i in range(2, int(-(-n**0.5//1))+1):

        if temp%i==0:

            cnt=0

            while temp%i==0:

                cnt+=1

                temp //= i

            arr.append([i, cnt])



    if temp!=1:

        arr.append([temp, 1])



    if arr==[]:

        arr.append([n, 1])



    return arr



N=int(eval(input()))

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

mod=10**9+7



M=1



dic={}



for a in A:

    Z=1

    arr=factorization(a)

    for b,c in arr:

        if b in dic:

            if c>dic[b]:

                M=M*pow(b,c-dic[b],mod)%mod

                dic[b]=c

        else:

            dic.update({b:c})

            M=M*pow(b,c,mod)%mod

M%=mod



print((sum([M*pow(a,mod-2,mod)%mod for a in A])%mod))

from fractions import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
M = 1
for a in A:
    M = (M * a) // gcd(M, a)
M %= mod
count = 0
for a in A:
    count = (count + M * pow(a, mod - 2, mod)) % mod
print(count)

from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-(n**0.5) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])
    if arr == []:
        arr.append([n, 1])
    return arr


N = int(eval(input()))
A = list(map(int, input().split()))
mod = 10**9 + 7
M = 1
dic = {}
for a in A:
    Z = 1
    arr = factorization(a)
    for b, c in arr:
        if b in dic:
            if c > dic[b]:
                M = M * pow(b, c - dic[b], mod) % mod
                dic[b] = c
        else:
            dic.update({b: c})
            M = M * pow(b, c, mod) % mod
M %= mod
print((sum([M * pow(a, mod - 2, mod) % mod for a in A]) % mod))

+from collections import * +from itertools import * +from bisect import * +from heapq import * +import copy +import math + + +def factorization(n): +    arr = [] +    temp = n +    for i in range(2, int(-(-(n**0.5) // 1)) + 1): +        if temp % i == 0: +            cnt = 0 +            while temp % i == 0: +                cnt += 1 +                temp //= i +            arr.append([i, cnt]) +    if temp != 1: +        arr.append([temp, 1]) +    if arr == []: +        arr.append([n, 1]) +    return arr + +dic = {} -    M = (M * a) // gcd(M, a) +    Z = 1 +    arr = factorization(a) +    for b, c in arr: +        if b in dic: +            if c > dic[b]: +                M = M * pow(b, c - dic[b], mod) % mod +                dic[b] = c +        else: +            dic.update({b: c}) +            M = M * pow(b, c, mod) % mod -count = 0 -for a in A: -    count = (count + M * pow(a, mod - 2, mod)) % mod -print(count) +print((sum([M * pow(a, mod - 2, mod) % mod for a in A]) % mod))