N = int(eval(input()))

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

mod = int(1e+9 + 7)

L = A[0]

p = mod - 2

X = []

while p != 0:

  X = [p%2] + X[:]

  p //= 2



def inved(x):

  y = 1

  for i in range(len(X)):

    if X[i] == 1:

      y *= x

      y %= mod

    if i != len(X) - 1:

      y *= y

      y %= mod

  return y



for i in range(N-1):

  a, b = L, A[i+1]

  while b != 0:

    a, b = b, a % b

  b = A[i+1] // a

  L = b * L

S = 0

for i in range(N):

  S += (L * inved(A[i])) % mod

  S %= mod

print(S)



N = int(eval(input()))

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

mod = int(1e+9 + 7)

L = A[0]

def inved(a):

  x, y, u, v, k, l = 1, 0, 0, 1, a, mod

  while l != 0:

    x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)

    k, l = l, k % l

  return x % mod

for i in range(N-1):

  a, b = L, A[i+1]

  while b != 0:

    a, b = b, a % b

  b = A[i+1] // a

  L = b * L

L %= mod

S = 0

for i in range(N):

  S += inved(A[i])

  S %= mod

S *= L

S %= mod

print(S)
N = int(eval(input()))
A = list(map(int, input().split()))
mod = int(1e9 + 7)
L = A[0]
p = mod - 2
X = []
while p != 0:
    X = [p % 2] + X[:]
    p //= 2


def inved(x):
    y = 1
    for i in range(len(X)):
        if X[i] == 1:
            y *= x
            y %= mod
        if i != len(X) - 1:
            y *= y
            y %= mod
    return y


for i in range(N - 1):
    a, b = L, A[i + 1]
    while b != 0:
        a, b = b, a % b
    b = A[i + 1] // a
    L = b * L
S = 0
for i in range(N):
    S += (L * inved(A[i])) % mod
    S %= mod
print(S)

N = int(eval(input()))
A = list(map(int, input().split()))
mod = int(1e9 + 7)
L = A[0]


def inved(a):
    x, y, u, v, k, l = 1, 0, 0, 1, a, mod
    while l != 0:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % mod


for i in range(N - 1):
    a, b = L, A[i + 1]
    while b != 0:
        a, b = b, a % b
    b = A[i + 1] // a
    L = b * L
L %= mod
S = 0
for i in range(N):
    S += inved(A[i])
    S %= mod
S *= L
S %= mod
print(S)

-p = mod - 2 -X = [] -while p != 0: -    X = [p % 2] + X[:] -    p //= 2 -def inved(x): -    y = 1 -    for i in range(len(X)): -        if X[i] == 1: -            y *= x -            y %= mod -        if i != len(X) - 1: -            y *= y -            y %= mod -    return y +def inved(a): +    x, y, u, v, k, l = 1, 0, 0, 1, a, mod +    while l != 0: +        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l) +        k, l = l, k % l +    return x % mod +L %= mod -    S += (L * inved(A[i])) % mod +    S += inved(A[i]) +S *= L +S %= mod