from fractions import gcd

n = int(eval(input()))

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

ans = [1] * n

while len(lcm) < (1 << 14):

  lcm.append(1)

  ans.append(0)

for i in range(13, -1, -1):

  bit = 1 << i

  for j in range(bit):

    new = lcm[j] // gcd(lcm[j], lcm[j | bit]) * lcm[j | bit]

    ans[j] = new // lcm[j] * ans[j] + new // lcm[j | bit] * ans[j | bit]

    ans[j] %= 1000000007

    lcm[j] = new

print((ans[0]))
from fractions import gcd

N = int(eval(input()))

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

MOD = 1000000007

lcm = 1

for a in A:

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

ans = 0

for a in A:

    ans += lcm // a

ans %= MOD

print(ans)
from fractions import gcd

n = int(eval(input()))
lcm = list(map(int, input().split()))
ans = [1] * n
while len(lcm) < (1 << 14):
    lcm.append(1)
    ans.append(0)
for i in range(13, -1, -1):
    bit = 1 << i
    for j in range(bit):
        new = lcm[j] // gcd(lcm[j], lcm[j | bit]) * lcm[j | bit]
        ans[j] = new // lcm[j] * ans[j] + new // lcm[j | bit] * ans[j | bit]
        ans[j] %= 1000000007
        lcm[j] = new
print((ans[0]))

from fractions import gcd

N = int(eval(input()))
A = list(map(int, input().split()))
MOD = 1000000007
lcm = 1
for a in A:
    lcm = a // gcd(lcm, a) * lcm
ans = 0
for a in A:
    ans += lcm // a
ans %= MOD
print(ans)

-n = int(eval(input())) -lcm = list(map(int, input().split())) -ans = [1] * n -while len(lcm) < (1 << 14): -    lcm.append(1) -    ans.append(0) -for i in range(13, -1, -1): -    bit = 1 << i -    for j in range(bit): -        new = lcm[j] // gcd(lcm[j], lcm[j | bit]) * lcm[j | bit] -        ans[j] = new // lcm[j] * ans[j] + new // lcm[j | bit] * ans[j | bit] -        ans[j] %= 1000000007 -        lcm[j] = new -print((ans[0])) +N = int(eval(input())) +A = list(map(int, input().split())) +MOD = 1000000007 +lcm = 1 +for a in A: +    lcm = a // gcd(lcm, a) * lcm +ans = 0 +for a in A: +    ans += lcm // a +ans %= MOD +print(ans)