from heapq import heappush,heappop,heapify

from collections import deque,defaultdict,Counter

import itertools

from itertools import permutations,combinations,groupby

import sys

import bisect

import string

import math

import time

import random

def S_():

    return input()

def LS():

    return [i for i in input().split()]

def I():

    return int(input())

def MI():

    return map(int,input().split())

def LI():

    return [int(i) for i in input().split()]

def LI_():

    return [int(i)-1 for i in input().split()]

def NI(n):

    return [int(input()) for i in range(n)]

def NI_(n):

    return [int(input())-1 for i in range(n)]

def StoI():

    return [ord(i)-97 for i in input()]

def ItoS(nn):

    return chr(nn+97)

def LtoS(ls):

    return ''.join([chr(i+97) for i in ls])

def GI(V,E,Directed=False,index=0):

    org_inp=[]

    g=[[] for i in range(n)]

    for i in range(E):

        inp=LI()

        org_inp.append(inp)

        if index==0:

            inp[0]-=1

            inp[1]-=1

        if len(inp)==2:

            a,b=inp

            g[a].append(b)

            if not Directed:

                g[b].append(a)

        elif len(inp)==3:

            a,b,c=inp

            aa=(inp[0],inp[2])

            bb=(inp[1],inp[2])

            g[a].append(bb)

            if not Directed:

                g[b].append(aa)

    return g,org_inp

def bit_combination(k,n=2):

    rt=[]

    for tb in range(n**k):

        s=[tb//(n**bt)%n for bt in range(k)]

        rt+=[s]

    return rt

def show(*inp,end='\n'):

    if show_flg:

        print(*inp,end=end)

YN=['Yes','No']

mo=10**9+7

inf=float('inf')

l_alp=string.ascii_lowercase

u_alp=string.ascii_uppercase

ts=time.time()

sys.setrecursionlimit(10**5)

input=lambda: sys.stdin.readline().rstrip()



def ran_input():

    import random

    n=random.randint(4,16)

    rmin,rmax=1,10

    a=[random.randint(rmin,rmax) for _ in range(n)]

    return n,a



def primeFactor(N):  # return prime factors of N as dictionary {prime p:power of p}

    i,n=2,N

    ret={}

    d,sq=2,99

    while i<=sq:

        k=0

        while n%i==0:

            n,k,ret[i]=n//i,k+1,k+1

        if k>0 or i==97:

            sq=int(n**(1/2)+0.5)

        if i<4:

            i=i*2-1

        else:

            i,d=i+d,d^6

    if n>1:

        ret[n]=1

    return ret



def PrimeNumSet(N):  # return the list of prime numbers in [2,N], using eratosthenes sieve

    Max = int(N**0.5)

    seachList = [i for i in range(2,N+1)]

    primeNum = []

    while seachList and seachList[0] <= Max:

        primeNum.append(seachList[0])

        tmp = seachList[0]

        seachList = [i for i in seachList if i % tmp != 0]

    primeNum.extend(seachList)

    return primeNum



def LCM(b,mo=10**9+7):  # retrun LCM of numbers in list b

    prs=PrimeNumSet(max(b))

    M=dict(zip(prs,[0]*len(prs)))

    for i in b:

        dc=primeFactor(i)

        for j,k in dc.items():

            M[j]=max(M[j],k)

    

    r=1

    for j,k in M.items():

        if k!=0:

            r*=pow(j,k,mo)

            r%=mo

    return r



show_flg=False

show_flg=True





ans=0



n=I()

a=LI()



m=LCM(a)



x=0

for i in a:

    x+=m*pow(i,mo-2,mo)

    x%=mo



print(x)

from heapq import heappush,heappop,heapify

from collections import deque,defaultdict,Counter

import itertools

from itertools import permutations,combinations,groupby

import sys

import bisect

import string

import math

import time

import random

def S_():

    return input()

def LS():

    return [i for i in input().split()]

def I():

    return int(input())

def MI():

    return map(int,input().split())

def LI():

    return [int(i) for i in input().split()]

def LI_():

    return [int(i)-1 for i in input().split()]

def NI(n):

    return [int(input()) for i in range(n)]

def NI_(n):

    return [int(input())-1 for i in range(n)]

def StoI():

    return [ord(i)-97 for i in input()]

def ItoS(nn):

    return chr(nn+97)

def LtoS(ls):

    return ''.join([chr(i+97) for i in ls])

def GI(V,E,Directed=False,index=0):

    org_inp=[]

    g=[[] for i in range(n)]

    for i in range(E):

        inp=LI()

        org_inp.append(inp)

        if index==0:

            inp[0]-=1

            inp[1]-=1

        if len(inp)==2:

            a,b=inp

            g[a].append(b)

            if not Directed:

                g[b].append(a)

        elif len(inp)==3:

            a,b,c=inp

            aa=(inp[0],inp[2])

            bb=(inp[1],inp[2])

            g[a].append(bb)

            if not Directed:

                g[b].append(aa)

    return g,org_inp

def bit_combination(k,n=2):

    rt=[]

    for tb in range(n**k):

        s=[tb//(n**bt)%n for bt in range(k)]

        rt+=[s]

    return rt

def show(*inp,end='\n'):

    if show_flg:

        print(*inp,end=end)

YN=['Yes','No']

mo=10**9+7

inf=float('inf')

l_alp=string.ascii_lowercase

u_alp=string.ascii_uppercase

ts=time.time()

sys.setrecursionlimit(10**5)

input=lambda: sys.stdin.readline().rstrip()



def ran_input():

    import random

    n=random.randint(4,16)

    rmin,rmax=1,10

    a=[random.randint(rmin,rmax) for _ in range(n)]

    return n,a



def primeFactor(N):  # return prime factors of N as dictionary {prime p:power of p}

    i,n=2,N

    ret={}

    d,sq=2,99

    while i<=sq:

        k=0

        while n%i==0:

            n,k,ret[i]=n//i,k+1,k+1

        if k>0 or i==97:

            sq=int(n**(1/2)+0.5)

        if i<4:

            i=i*2-1

        else:

            i,d=i+d,d^6

    if n>1:

        ret[n]=1

    return ret



def PrimeNumSet(N):  # return the list of prime numbers in [2,N], using eratosthenes sieve

    Max = int(N**0.5)

    seachList = [i for i in range(2,N+1)]

    primeNum = []

    while seachList:

        if seachList[0] <= Max:

            break

        primeNum.append(seachList[0])

        tmp = seachList[0]

        seachList = [i for i in seachList if i % tmp != 0]

    primeNum.extend(seachList)

    return primeNum



def LCM(b,mo=10**9+7):  # retrun LCM of numbers in list b

    prs=PrimeNumSet(max(b))

    M=dict(zip(prs,[0]*len(prs)))

    for i in b:

        dc=primeFactor(i)

        for j,k in dc.items():

            M[j]=max(M[j],k)

    

    r=1

    for j,k in M.items():

        if k!=0:

            r*=pow(j,k,mo)

            r%=mo

    return r



show_flg=False

show_flg=True





ans=0



n=I()

a=LI()



m=LCM(a)



x=0

for i in a:

    x+=m*pow(i,mo-2,mo)

    x%=mo



print(x)

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, groupby
import sys
import bisect
import string
import math
import time
import random


def S_():
    return input()


def LS():
    return [i for i in input().split()]


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return [int(i) for i in input().split()]


def LI_():
    return [int(i) - 1 for i in input().split()]


def NI(n):
    return [int(input()) for i in range(n)]


def NI_(n):
    return [int(input()) - 1 for i in range(n)]


def StoI():
    return [ord(i) - 97 for i in input()]


def ItoS(nn):
    return chr(nn + 97)


def LtoS(ls):
    return "".join([chr(i + 97) for i in ls])


def GI(V, E, Directed=False, index=0):
    org_inp = []
    g = [[] for i in range(n)]
    for i in range(E):
        inp = LI()
        org_inp.append(inp)
        if index == 0:
            inp[0] -= 1
            inp[1] -= 1
        if len(inp) == 2:
            a, b = inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp) == 3:
            a, b, c = inp
            aa = (inp[0], inp[2])
            bb = (inp[1], inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g, org_inp


def bit_combination(k, n=2):
    rt = []
    for tb in range(n**k):
        s = [tb // (n**bt) % n for bt in range(k)]
        rt += [s]
    return rt


def show(*inp, end="\n"):
    if show_flg:
        print(*inp, end=end)


YN = ["Yes", "No"]
mo = 10**9 + 7
inf = float("inf")
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**5)
input = lambda: sys.stdin.readline().rstrip()


def ran_input():
    import random

    n = random.randint(4, 16)
    rmin, rmax = 1, 10
    a = [random.randint(rmin, rmax) for _ in range(n)]
    return n, a


def primeFactor(N):  # return prime factors of N as dictionary {prime p:power of p}
    i, n = 2, N
    ret = {}
    d, sq = 2, 99
    while i <= sq:
        k = 0
        while n % i == 0:
            n, k, ret[i] = n // i, k + 1, k + 1
        if k > 0 or i == 97:
            sq = int(n ** (1 / 2) + 0.5)
        if i < 4:
            i = i * 2 - 1
        else:
            i, d = i + d, d ^ 6
    if n > 1:
        ret[n] = 1
    return ret


def PrimeNumSet(
    N,
):  # return the list of prime numbers in [2,N], using eratosthenes sieve
    Max = int(N**0.5)
    seachList = [i for i in range(2, N + 1)]
    primeNum = []
    while seachList and seachList[0] <= Max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def LCM(b, mo=10**9 + 7):  # retrun LCM of numbers in list b
    prs = PrimeNumSet(max(b))
    M = dict(zip(prs, [0] * len(prs)))
    for i in b:
        dc = primeFactor(i)
        for j, k in dc.items():
            M[j] = max(M[j], k)
    r = 1
    for j, k in M.items():
        if k != 0:
            r *= pow(j, k, mo)
            r %= mo
    return r


show_flg = False
show_flg = True
ans = 0
n = I()
a = LI()
m = LCM(a)
x = 0
for i in a:
    x += m * pow(i, mo - 2, mo)
    x %= mo
print(x)

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, groupby
import sys
import bisect
import string
import math
import time
import random


def S_():
    return input()


def LS():
    return [i for i in input().split()]


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return [int(i) for i in input().split()]


def LI_():
    return [int(i) - 1 for i in input().split()]


def NI(n):
    return [int(input()) for i in range(n)]


def NI_(n):
    return [int(input()) - 1 for i in range(n)]


def StoI():
    return [ord(i) - 97 for i in input()]


def ItoS(nn):
    return chr(nn + 97)


def LtoS(ls):
    return "".join([chr(i + 97) for i in ls])


def GI(V, E, Directed=False, index=0):
    org_inp = []
    g = [[] for i in range(n)]
    for i in range(E):
        inp = LI()
        org_inp.append(inp)
        if index == 0:
            inp[0] -= 1
            inp[1] -= 1
        if len(inp) == 2:
            a, b = inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp) == 3:
            a, b, c = inp
            aa = (inp[0], inp[2])
            bb = (inp[1], inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g, org_inp


def bit_combination(k, n=2):
    rt = []
    for tb in range(n**k):
        s = [tb // (n**bt) % n for bt in range(k)]
        rt += [s]
    return rt


def show(*inp, end="\n"):
    if show_flg:
        print(*inp, end=end)


YN = ["Yes", "No"]
mo = 10**9 + 7
inf = float("inf")
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**5)
input = lambda: sys.stdin.readline().rstrip()


def ran_input():
    import random

    n = random.randint(4, 16)
    rmin, rmax = 1, 10
    a = [random.randint(rmin, rmax) for _ in range(n)]
    return n, a


def primeFactor(N):  # return prime factors of N as dictionary {prime p:power of p}
    i, n = 2, N
    ret = {}
    d, sq = 2, 99
    while i <= sq:
        k = 0
        while n % i == 0:
            n, k, ret[i] = n // i, k + 1, k + 1
        if k > 0 or i == 97:
            sq = int(n ** (1 / 2) + 0.5)
        if i < 4:
            i = i * 2 - 1
        else:
            i, d = i + d, d ^ 6
    if n > 1:
        ret[n] = 1
    return ret


def PrimeNumSet(
    N,
):  # return the list of prime numbers in [2,N], using eratosthenes sieve
    Max = int(N**0.5)
    seachList = [i for i in range(2, N + 1)]
    primeNum = []
    while seachList:
        if seachList[0] <= Max:
            break
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def LCM(b, mo=10**9 + 7):  # retrun LCM of numbers in list b
    prs = PrimeNumSet(max(b))
    M = dict(zip(prs, [0] * len(prs)))
    for i in b:
        dc = primeFactor(i)
        for j, k in dc.items():
            M[j] = max(M[j], k)
    r = 1
    for j, k in M.items():
        if k != 0:
            r *= pow(j, k, mo)
            r %= mo
    return r


show_flg = False
show_flg = True
ans = 0
n = I()
a = LI()
m = LCM(a)
x = 0
for i in a:
    x += m * pow(i, mo - 2, mo)
    x %= mo
print(x)

-    while seachList and seachList[0] <= Max: +    while seachList: +        if seachList[0] <= Max: +            break