def gcd(a: int, b: int) -> int:

    """a, bの最大公約数(greatest common divisor:GCD)を求める

    計算量: O(log(min(a, b)))

    """

    if b == 0:

        return a

    return gcd(b, a%b)





def lcm(a, b):

    """a, bの最小公倍数(least common multiple:LCM)を求める

    計算量: O(log(min(a, b)))"""

    return (a * b) // gcd(a, b)





def multi_gcd(array: list) -> int:

    """arrayのGCDを求める

    計算量: O(Nlog)

    """

    n = len(array)

    ans = array[0]

    for i in range(1, n):

        ans = gcd(ans, array[i])

    return ans





def multi_lcm(array):

    """arrayのLCMを求める"""

    ans = array[0]

    for i in range(1, len(array)):

        ans = (ans * array[i]) // gcd(ans, array[i])

    return ans





n = int(eval(input()))

MOD = 10**9 + 7

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

lcm_ = multi_lcm(a) % MOD

ans = 0

for i in range(n):

    ans += lcm_ * pow(a[i], MOD - 2, MOD)

    ans %= MOD

print((ans % MOD))

def multi_lcm(array: list) -> dict:

    """arrayのLCMを素因数分解の積の形として求める(ABC152-E)

    入出力例: [4, 18, 21] -> {2: 2, 3: 2, 7: 1}

    key, val = 素因数, 素因数の個数

    """

    pf = {}  # pf: prime_factor

    for num in array:

        for k in range(2, int(num**0.5) + 1):

            cnt = 0

            while num % k == 0:

                cnt += 1

                num //= k

            if cnt != 0:

                if k not in pf:

                    pf[k] = cnt

                else:

                    pf[k] = max(cnt, pf[k])

        if num != 1:

            if num not in pf:

                pf[num] = 1

    return pf



  

n = int(eval(input()))

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

MOD = 10**9 + 7



factor = multi_lcm(a)

lcm_ = 1

for num in factor:

    cnt = factor[num]

    lcm_ *= pow(num, cnt, MOD)

    lcm_ %= MOD



ans = 0

for num in a:

    ans += lcm_ * pow(num, MOD - 2, MOD)

    ans %= MOD

print(ans)
def gcd(a: int, b: int) -> int:
    """a, bの最大公約数(greatest common divisor:GCD)を求める
    計算量: O(log(min(a, b)))
    """
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    """a, bの最小公倍数(least common multiple:LCM)を求める
    計算量: O(log(min(a, b)))"""
    return (a * b) // gcd(a, b)


def multi_gcd(array: list) -> int:
    """arrayのGCDを求める
    計算量: O(Nlog)
    """
    n = len(array)
    ans = array[0]
    for i in range(1, n):
        ans = gcd(ans, array[i])
    return ans


def multi_lcm(array):
    """arrayのLCMを求める"""
    ans = array[0]
    for i in range(1, len(array)):
        ans = (ans * array[i]) // gcd(ans, array[i])
    return ans


n = int(eval(input()))
MOD = 10**9 + 7
a = list(map(int, input().split()))
lcm_ = multi_lcm(a) % MOD
ans = 0
for i in range(n):
    ans += lcm_ * pow(a[i], MOD - 2, MOD)
    ans %= MOD
print((ans % MOD))

def multi_lcm(array: list) -> dict:
    """arrayのLCMを素因数分解の積の形として求める(ABC152-E)
    入出力例: [4, 18, 21] -> {2: 2, 3: 2, 7: 1}
    key, val = 素因数, 素因数の個数
    """
    pf = {}  # pf: prime_factor
    for num in array:
        for k in range(2, int(num**0.5) + 1):
            cnt = 0
            while num % k == 0:
                cnt += 1
                num //= k
            if cnt != 0:
                if k not in pf:
                    pf[k] = cnt
                else:
                    pf[k] = max(cnt, pf[k])
        if num != 1:
            if num not in pf:
                pf[num] = 1
    return pf


n = int(eval(input()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
factor = multi_lcm(a)
lcm_ = 1
for num in factor:
    cnt = factor[num]
    lcm_ *= pow(num, cnt, MOD)
    lcm_ %= MOD
ans = 0
for num in a:
    ans += lcm_ * pow(num, MOD - 2, MOD)
    ans %= MOD
print(ans)

-def gcd(a: int, b: int) -> int: -    """a, bの最大公約数(greatest common divisor:GCD)を求める -    計算量: O(log(min(a, b))) +def multi_lcm(array: list) -> dict: +    """arrayのLCMを素因数分解の積の形として求める(ABC152-E) +    入出力例: [4, 18, 21] -> {2: 2, 3: 2, 7: 1} +    key, val = 素因数, 素因数の個数 -    if b == 0: -        return a -    return gcd(b, a % b) - - -def lcm(a, b): -    """a, bの最小公倍数(least common multiple:LCM)を求める -    計算量: O(log(min(a, b)))""" -    return (a * b) // gcd(a, b) - - -def multi_gcd(array: list) -> int: -    """arrayのGCDを求める -    計算量: O(Nlog) -    """ -    n = len(array) -    ans = array[0] -    for i in range(1, n): -        ans = gcd(ans, array[i]) -    return ans - - -def multi_lcm(array): -    """arrayのLCMを求める""" -    ans = array[0] -    for i in range(1, len(array)): -        ans = (ans * array[i]) // gcd(ans, array[i]) -    return ans +    pf = {}  # pf: prime_factor +    for num in array: +        for k in range(2, int(num**0.5) + 1): +            cnt = 0 +            while num % k == 0: +                cnt += 1 +                num //= k +            if cnt != 0: +                if k not in pf: +                    pf[k] = cnt +                else: +                    pf[k] = max(cnt, pf[k]) +        if num != 1: +            if num not in pf: +                pf[num] = 1 +    return pf +a = list(map(int, input().split())) -a = list(map(int, input().split())) -lcm_ = multi_lcm(a) % MOD +factor = multi_lcm(a) +lcm_ = 1 +for num in factor: +    cnt = factor[num] +    lcm_ *= pow(num, cnt, MOD) +    lcm_ %= MOD -for i in range(n): -    ans += lcm_ * pow(a[i], MOD - 2, MOD) +for num in a: +    ans += lcm_ * pow(num, MOD - 2, MOD) -print((ans % MOD)) +print(ans)