Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce, partial
import sys


def input():
    return sys.stdin.readline()[:-1]

def lcm(a, b):
	return a * b // gcd(a, b)

def func(a, b, l):
	mod = 10**9 + 7
	return (a +  l*modinv(b, mod)) % mod

def func1(a, b, l):
	mod = 10**9 + 7
	return (a + l//b) % mod

def modinv(a, b):
	return pow(a,b-2,b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = tuple(map(int, input().split()))

	l = reduce(lcm, A) #% mod
	A = (0,) + A
	
	ans = reduce(partial(func1, l=l), A)
	print(ans)
	

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import sys


def input():
    return sys.stdin.readline()[:-1]

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    return gcd(b, a%b)

def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = tuple(map(int, input().split()))

	ans = reduce(lcm, A) 
	
	B = (ans//i for i in A)
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
import sys


def input():
    return sys.stdin.readline()[:-1]


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = tuple(map(int, input().split()))

	ans = reduce(lcm, A) 
	
	B = (ans//i for i in A)
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Runtime Error):
#from math import gcd
from fractions import gcd
from functools import reduce
import numpy as np
import sys
#import time

"""
def input():
    return sys.stdin.readline()[:-1]
"""

def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = list(map(int, input().split()))

	ans = reduce(lcm, A)
	"""
	a = 1
	for i in A:
		a = lcm(a, i)
	"""
	#print(a, ans)
	B = np.array([ans//i for i in A])
	print(np.sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce
import sys
#import time


def input():
    return sys.stdin.readline()[:-1]


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = list(map(int, input().split()))

	ans = reduce(lcm, A)
	"""
	a = 1
	for i in A:
		a = lcm(a, i)
	"""
	#print(a, ans)
	B = [ans//i for i in A]
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce
import sys


def input():
    return sys.stdin.readline()[:-1]


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = [i for i in map(int, input().split())]
	
	ans = reduce(lcm, A)
	"""
	a = 1
	for i in A:
		a = lcm(a, i)
	"""
	#print(a, ans)
	B = [ans//i for i in A]
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = [i for i in map(int, input().split())]
	
	ans = reduce(lcm, A)
	"""
	a = 1
	for i in A:
		a = lcm(a, i)
	"""
	#print(a, ans)
	B = [ans//i for i in A]
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
#from functools import reduce


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = [i for i in map(int, input().split())]
	
	#ans = reduce(lcm, A)
	
	a = 1
	for i in A:
		a = lcm(a, i)

	#print(a, ans)
	B = [a//i for i in A]
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce


def lcm(a, b):
	return a * b // gcd(a, b)

def main():
	mod = 10**9 + 7
	N = int(input())
	A = [i for i in map(int, input().split())]
	
	ans = reduce(lcm, A)
	
	a = 1
	for i in A:
		a = lcm(a, i)

	#print(a, ans)
	B = [a//i for i in A]
	print(sum(B) % mod)

if __name__ == "__main__":
	main()


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
#from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

#ans = reduce(lcm, A)

a = 1
for i in A:
	a = lcm(a, i)

#print(a, ans)
B = [a//i for i in A]

print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Time Limit Exceeded):
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // math.gcd(a, b)


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

ans = reduce(lcm, A)

B = [ans//i for i in A]

print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // math.gcd(a, b)


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

ans = reduce(lcm, A)


B = [ans//i for i in A]

ans = reduce(math.gcd, B)
if ans != 1:
	B_ = [i//ans for i in B]
	print(sum(B_) % mod)
else:
	print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // math.gcd(a, b)


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

ans = reduce(lcm, A)

B = [ans//i for i in A]
print(sum(B) % mod)


Fixed submission:
#from math import gcd
from fractions import gcd
from functools import reduce

mod = 10**9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)


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

ans = reduce(lcm, A)

#print(ans)
B = [ans//i for i in A]

print(sum(B) % mod)