#???

n=int(eval(input()))

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

MOD=10**9+7



def gcd(x,y):

  if x<y:x,y=y,x

  if y==0:return x

  return gcd(x%y,y)



def lcm(x,y):

  return x*y//gcd(x,y)



def inv(x):

  return pow(x,MOD-2,MOD)



L=1

for i in a:

  L=lcm(L,i)



L=L%MOD

ans=0

for i in a:

  ans=(ans+L*inv(i))%MOD

  



print(ans)
n,*a=list(map(int,open(0).read().split()))

MOD=10**9+7

from fractions import gcd



def lcm(x,y):return x*y//gcd(x,y)

def inv(x):return pow(x,MOD-2,MOD)



L=1

for i in a:L=lcm(L,i)

L=L%MOD

ans=0

for i in a:ans=(ans+L*inv(i))%MOD

  

print(ans)
# ???
n = int(eval(input()))
a = list(map(int, input().split()))
MOD = 10**9 + 7


def gcd(x, y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x
    return gcd(x % y, y)


def lcm(x, y):
    return x * y // gcd(x, y)


def inv(x):
    return pow(x, MOD - 2, MOD)


L = 1
for i in a:
    L = lcm(L, i)
L = L % MOD
ans = 0
for i in a:
    ans = (ans + L * inv(i)) % MOD
print(ans)

n, *a = list(map(int, open(0).read().split()))
MOD = 10**9 + 7
from fractions import gcd


def lcm(x, y):
    return x * y // gcd(x, y)


def inv(x):
    return pow(x, MOD - 2, MOD)


L = 1
for i in a:
    L = lcm(L, i)
L = L % MOD
ans = 0
for i in a:
    ans = (ans + L * inv(i)) % MOD
print(ans)

-# ??? -n = int(eval(input())) -a = list(map(int, input().split())) +n, *a = list(map(int, open(0).read().split())) - - -def gcd(x, y): -    if x < y: -        x, y = y, x -    if y == 0: -        return x -    return gcd(x % y, y) +from fractions import gcd