def PrimeFactorization(m):

    pf = {}

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

        while m % i == 0:

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

            m //= i

    if m > 1:

        pf[m] = 1

    return pf





def lcmlist(l):

    from collections import defaultdict

    d = defaultdict(int)

    for i in set(l):

        for k, v in list(PrimeFactorization(i).items()):

            if v > d[k]:

                d[k] = v

    n = 1

    for k, v in list(d.items()):

        n *= k ** v

    return n



n=int(eval(input()))

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

x=lcmlist(a)

ans=0

for i in a:

  ans+=x//i

ans%=1000000007

print(ans)
from fractions import gcd

from functools import reduce

n=int(eval(input()))

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

x=reduce(lambda x,y: y//gcd(x,y)*x, a)

ans=0

for i in a:

  ans+=x//i

ans%=1000000007

print(ans)
def PrimeFactorization(m):
    pf = {}
    for i in range(2, int(m**0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        pf[m] = 1
    return pf


def lcmlist(l):
    from collections import defaultdict

    d = defaultdict(int)
    for i in set(l):
        for k, v in list(PrimeFactorization(i).items()):
            if v > d[k]:
                d[k] = v
    n = 1
    for k, v in list(d.items()):
        n *= k**v
    return n


n = int(eval(input()))
a = list(map(int, input().split()))
x = lcmlist(a)
ans = 0
for i in a:
    ans += x // i
ans %= 1000000007
print(ans)

from fractions import gcd
from functools import reduce

n = int(eval(input()))
a = list(map(int, input().split()))
x = reduce(lambda x, y: y // gcd(x, y) * x, a)
ans = 0
for i in a:
    ans += x // i
ans %= 1000000007
print(ans)

-def PrimeFactorization(m): -    pf = {} -    for i in range(2, int(m**0.5) + 1): -        while m % i == 0: -            pf[i] = pf.get(i, 0) + 1 -            m //= i -    if m > 1: -        pf[m] = 1 -    return pf - - -def lcmlist(l): -    from collections import defaultdict - -    d = defaultdict(int) -    for i in set(l): -        for k, v in list(PrimeFactorization(i).items()): -            if v > d[k]: -                d[k] = v -    n = 1 -    for k, v in list(d.items()): -        n *= k**v -    return n - +from fractions import gcd +from functools import reduce -x = lcmlist(a) +x = reduce(lambda x, y: y // gcd(x, y) * x, a)