open System
#nowarn "25"

let inline readLine typeOperator = stdin.ReadLine() |> typeOperator
let inline readArray typeOperator = stdin.ReadLine().Split ' ' |> Array.map typeOperator
let modval = 1000000007

/// Seq の型拡張
module Seq =
    /// max 以下の素因数のシーケンスを生成する
    /// 実行の度計算するので繰り返し使う場合は変数に入れて使い回す
    let initPrime max =
        let isPrime (primes: int array) num =
            let rec recIsPrime (primes: int array) num i =
                if num = 2 || i >= primes.Length then true
                elif num < 2 || num % 2 = 0 then false
                else
                    let p = primes.[i]
                    if p = 0 || sqrt (double num) < (double p) then true
                    elif num % p = 0 then false
                    else recIsPrime primes num (i + 1)
            recIsPrime primes num 0

        seq {
            let primes = Array.zeroCreate<int> (max / 2 + 1)
            let mutable index = 0
            for i in 2..max do
                if i |> isPrime primes then
                    primes.[index] <- i
                    index <- index + 1
                    yield i
        }

    /// mod をとりながら合計を計算する
    let modSum modval seq =
        seq |> Seq.fold (fun acc elem -> (acc + elem) % modval) 0L

/// modの二分累乗法
/// a^n mod m を求める
let modpow a n m =
    let rec recModPow a n m res =
        // eprintfn "a: %d, n: %d, m: %d, res: %d" a n m res
        if n <= 0 then res
        elif n &&& 1 = 1 then recModPow (a * a % m) (n >>> 1) m (res * a % m)
        else recModPow (a * a % m) (n >>> 1) m res
    recModPow a n m 1

/// modの世界での逆元を求める
/// num^(-1) mod m を求める
let modInverse num m =
    let rec recModInverse a b u v =
        let t = a / b
        let a' = a - t * b
        let a, b = b, a'
        let u' = u - t * v
        let u, v = v, u'
        // eprintfn "%d %d %d %d" a b u v
        b |> function
        | 0L -> u
        |_ -> recModInverse a b u v
    let a, b, u, v = num, m, 1L, 0L
    let u = recModInverse a b u v
    if u < 0L then (u + m) else u

// eprintfn "main"
let n = readLine int
// eprintfn "%d" n
let A = readArray int
// eprintfn "%A" A
let MaxA = A |> Seq.max
// eprintfn "maxA: %d" MaxA
let primes = MaxA |> Seq.initPrime |> List.ofSeq
// eprintfn "primeSeq: %A" primes
let primeCounts = Array.zeroCreate<int> MaxA
// eprintfn "primeCounts: %A" primeCounts
let rec countPrime num prime count =
    // eprintfn "num: %d, prime: %d, count: %d" num prime count
    if num % prime <> 0 then count
    else (num / prime) |> function
        | 0 -> count
        | 1 -> count + 1
        |_ -> countPrime (num / prime) prime (count + 1)
// eprintfn "count"
for ai in A do
    for p in primes do
        primeCounts.[p] <- max primeCounts.[p] (countPrime ai p 0)
// eprintfn "calced primeCounts: %A" primeCounts
// eprintfn "mod lcm"
let modlcm =
    Seq.init MaxA (fun i -> modpow i primeCounts.[i] modval)
    |> Seq.map int64
    |> Seq.fold (fun acc elem -> (int64 acc) * (int64 elem) % (int64 modval)) 1L
// eprintfn "mod lcm: %d" modlcm
// eprintfn "answer"
A |> Seq.map (fun ai -> modlcm * (modInverse (int64 ai) (int64 modval)) % (int64 modval))
|> Seq.modSum (int64 modval)
|> printfn "%d"
