def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby, product

    from bisect import bisect_left,bisect_right

    from heapq import heapify, heappop, heappush

    import math



    #inf = 10**17

    mod = 10**9 + 7



    def gcd(a, b):

        if b == 0:

            return a

        else:

            return gcd(b, a % b)

    

    def gcd_group(arr):

        g = gcd(arr[0], arr[1])

        for i in range(2, len(arr)):

            g = gcd(g, arr[i])

        return g

    

    def lcm(a, b):

        g = gcd(a, b)

        return (a*b)//g

    

    def lcm_group(arr):

        l = lcm(arr[0], arr[1])

        for i in range(2, len(arr)):

            l = lcm(l, arr[i])

        return l

    

    # groupは要素1つでエラー



    # aの逆元を求める

    def inv(a, mod=mod):

        return pow(a, mod-2, mod)



    n = int(eval(input()))

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

    if n == 1:

        print((1))

    else:

        l = lcm_group(a)

        res = 0

        for i in a:

            res += inv(i)

        print((res*l%mod))



if __name__ == '__main__':

    main()
def main():

    import sys

    input = sys.stdin.readline

    sys.setrecursionlimit(10**7)

    from collections import Counter, deque

    #from collections import defaultdict

    from itertools import combinations, permutations, accumulate, groupby, product

    from bisect import bisect_left,bisect_right

    from heapq import heapify, heappop, heappush

    import math



    #inf = 10**17

    mod = 10**9 + 7



    # 素因数分解

    def prime_decomp(n):

        i = 2

        res = []

        while i ** 2 <= n:

            while n % i==0:

                n //= i

                res.append(i)

            i += 1

        if n > 1:

            res.append(n)

        return res

        # 素因数のリストを返す(0, 1は空)



    # aの逆元を求める

    def inv(a, mod=mod):

        return pow(a, mod-2, mod)



    n = int(eval(input()))

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





    lcm = [0]*(max(a)+1)

    for i in a:

        l = prime_decomp(i)

        c = Counter(l)

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

            if lcm[k] < v:

                lcm[k] = v

    

    b = 1

    for i in range(len(lcm)):

        if lcm[i] != 0:

            b *= pow(i, lcm[i], mod)

    

    if n == 1:

        print((1))

    else:

        res = 0

        for i in a:

            res += inv(i)

        print((res*b%mod))



if __name__ == '__main__':

    main()
def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left, bisect_right
    from heapq import heapify, heappop, heappush
    import math

    # inf = 10**17
    mod = 10**9 + 7

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

    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g

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

    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l

    # groupは要素1つでエラー
    # aの逆元を求める
    def inv(a, mod=mod):
        return pow(a, mod - 2, mod)

    n = int(eval(input()))
    a = list(map(int, input().split()))
    if n == 1:
        print((1))
    else:
        l = lcm_group(a)
        res = 0
        for i in a:
            res += inv(i)
        print((res * l % mod))


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque

    # from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left, bisect_right
    from heapq import heapify, heappop, heappush
    import math

    # inf = 10**17
    mod = 10**9 + 7
    # 素因数分解
    def prime_decomp(n):
        i = 2
        res = []
        while i**2 <= n:
            while n % i == 0:
                n //= i
                res.append(i)
            i += 1
        if n > 1:
            res.append(n)
        return res
        # 素因数のリストを返す(0, 1は空)

    # aの逆元を求める
    def inv(a, mod=mod):
        return pow(a, mod - 2, mod)

    n = int(eval(input()))
    a = list(map(int, input().split()))
    lcm = [0] * (max(a) + 1)
    for i in a:
        l = prime_decomp(i)
        c = Counter(l)
        for k, v in list(c.items()):
            if lcm[k] < v:
                lcm[k] = v
    b = 1
    for i in range(len(lcm)):
        if lcm[i] != 0:
            b *= pow(i, lcm[i], mod)
    if n == 1:
        print((1))
    else:
        res = 0
        for i in a:
            res += inv(i)
        print((res * b % mod))


if __name__ == "__main__":
    main()

+    # 素因数分解 +    def prime_decomp(n): +        i = 2 +        res = [] +        while i**2 <= n: +            while n % i == 0: +                n //= i +                res.append(i) +            i += 1 +        if n > 1: +            res.append(n) +        return res +        # 素因数のリストを返す(0, 1は空) -    def gcd(a, b): -        if b == 0: -            return a -        else: -            return gcd(b, a % b) - -    def gcd_group(arr): -        g = gcd(arr[0], arr[1]) -        for i in range(2, len(arr)): -            g = gcd(g, arr[i]) -        return g - -    def lcm(a, b): -        g = gcd(a, b) -        return (a * b) // g - -    def lcm_group(arr): -        l = lcm(arr[0], arr[1]) -        for i in range(2, len(arr)): -            l = lcm(l, arr[i]) -        return l - -    # groupは要素1つでエラー +    lcm = [0] * (max(a) + 1) +    for i in a: +        l = prime_decomp(i) +        c = Counter(l) +        for k, v in list(c.items()): +            if lcm[k] < v: +                lcm[k] = v +    b = 1 +    for i in range(len(lcm)): +        if lcm[i] != 0: +            b *= pow(i, lcm[i], mod) -        l = lcm_group(a) -        print((res * l % mod)) +        print((res * b % mod))