import fractions

n=int(eval(input()))

A=[int(i) for i in input().split()]

mod=10**9+7



lcm=A[0]

for i in range(1,n):

  if lcm%A[i]!=0:

    lcm=lcm*A[i]//fractions.gcd(lcm,A[i])

lcm%=mod

ans=0

for i in range(n):

  ans=(ans+lcm*pow(A[i],mod-2,mod))%mod

print(ans)

n=int(eval(input()))

A=[int(i) for i in input().split()]

mod=10**9+7

import collections



P=collections.defaultdict(int)

ans=0

for a in A:

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

  pf={}

  for i in range(2,int(a**0.5)+1):

    while a%i==0:

      pf[i]=pf.get(i,0)+1

      a//=i

  if a>1:

    pf[a]=1

  for p in list(pf.keys()):

    P[p]=max(P[p],pf[p])



for p in list(P.keys()):

  ans=(ans*pow(p,P[p],mod))%mod



print(ans)
import fractions

n = int(eval(input()))
A = [int(i) for i in input().split()]
mod = 10**9 + 7
lcm = A[0]
for i in range(1, n):
    if lcm % A[i] != 0:
        lcm = lcm * A[i] // fractions.gcd(lcm, A[i])
lcm %= mod
ans = 0
for i in range(n):
    ans = (ans + lcm * pow(A[i], mod - 2, mod)) % mod
print(ans)

n = int(eval(input()))
A = [int(i) for i in input().split()]
mod = 10**9 + 7
import collections

P = collections.defaultdict(int)
ans = 0
for a in A:
    ans = (ans + pow(a, mod - 2, mod)) % mod
    pf = {}
    for i in range(2, int(a**0.5) + 1):
        while a % i == 0:
            pf[i] = pf.get(i, 0) + 1
            a //= i
    if a > 1:
        pf[a] = 1
    for p in list(pf.keys()):
        P[p] = max(P[p], pf[p])
for p in list(P.keys()):
    ans = (ans * pow(p, P[p], mod)) % mod
print(ans)

-import fractions - -lcm = A[0] -for i in range(1, n): -    if lcm % A[i] != 0: -        lcm = lcm * A[i] // fractions.gcd(lcm, A[i]) -lcm %= mod +import collections + +P = collections.defaultdict(int) -for i in range(n): -    ans = (ans + lcm * pow(A[i], mod - 2, mod)) % mod +for a in A: +    ans = (ans + pow(a, mod - 2, mod)) % mod +    pf = {} +    for i in range(2, int(a**0.5) + 1): +        while a % i == 0: +            pf[i] = pf.get(i, 0) + 1 +            a //= i +    if a > 1: +        pf[a] = 1 +    for p in list(pf.keys()): +        P[p] = max(P[p], pf[p]) +for p in list(P.keys()): +    ans = (ans * pow(p, P[p], mod)) % mod