import java.util.*

fun main(args: Array<String>) {
    readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toInt)
    val lcm = Sieve.lcm(A)
    val ans = A.map { i -> lcm / MInt(i) }.reduce { acc, i -> acc + i }
    println(ans)
}

object Sieve {
    private val N = Math.sqrt(1000000.0).toInt()
    private val primes: Array<Int>

    init {
        val que = ArrayDeque<Int>()
        val sieve = BooleanArray(N+1) { true }
        sieve[0] = false
        sieve[1] = false
        for (i in 2..N) {
            if (!sieve[i]) continue
            que.push(i)
            for (j in (i*2)..N step i) {
                sieve[j] = false
            }
        }
        primes = que.toTypedArray()
    }

    fun lcm(array: List<Int>): MInt {
        val map = HashMap<Int, Int>()
        for (n in array) {
            fact(n).forEach { e ->
                val ex = map[e.key] ?: 0
                map[e.key] = Math.max(ex, e.value)
            }
        }
        var mint = MInt(1)
        map.forEach { e ->
            mint = mint * MInt(e.key).pow(e.value)
        }
        return mint
    }

    fun fact(n: Int): HashMap<Int, Int> {
        val map = HashMap<Int, Int>()
        var tmp = n
        for (prime in primes) {
            if (tmp % prime == 0) {
                var cnt = 0
                while (tmp % prime == 0) {
                    tmp /= prime
                    cnt++
                }
                map[prime] = cnt
            }
        }
        if (tmp != 1) {
            map[tmp] = 1
        }
        return map
    }
}

class MInt {
    private val MOD = 1000000007L
    var v: Long

    constructor(v: Long) {
        this.v = v % MOD
    }

    constructor(v: Int) {
        this.v = v.toLong() % MOD
    }

    operator fun plus(b: MInt): MInt {
        val a = MInt(v)
        a += b
        return a
    }

    operator fun minus(b: MInt): MInt {
        val a = MInt(v)
        a -= b
        return a
    }

    operator fun times(b: MInt): MInt {
        val a = MInt(v)
        a *= b
        return a
    }

    operator fun div(b: MInt): MInt {
        val a = MInt(v)
        a /= b
        return a
    }

    operator fun plusAssign(b: MInt) {
        v += b.v
        if (v >= MOD) v -= MOD
    }

    operator fun minusAssign(b: MInt) {
        v -= b.v
        if (v < 0) v += MOD
    }

    operator fun timesAssign(b: MInt) {
        v *= b.v
        v %= MOD
    }

    operator fun divAssign(b: MInt) {
        this *= b.inv()
    }

    fun inv(): MInt {
        var a = v
        var b = MOD
        var u = 1L
        var w = 0L
        while (b != 0L) {
            val t = a / b
            a -= t * b
            u -= t * w
            var tmp = a
            a = b
            b = tmp
            tmp = u
            u = w
            w = tmp
        }
        u %= MOD
        if (u < 0) u += MOD
        return MInt(u)
    }

    fun pow(n: Int): MInt {
        var a = MInt(1)
        for (i in 1..n) a = a * this
        return a
    }

    override fun toString(): String {
        return v.toString()
    }
}