import java.lang.Math

fun main(args: Array<String>) {
    val mod = 1000000007L
    val A_MAX = 1000000
    val N = readInputLine().toInt()
    val AArr = readInputLine().split(" ").map { it.toLong() }.toLongArray()

    val inverse = LongArray(A_MAX + 1)
    inverse[0] = 1L
    inverse[1] = 1L
    for (i in 2..A_MAX) {
        inverse[i] = (mod - inverse[mod.toInt() % i] * (mod / i.toLong()) % mod)
    }

    val minFactor = LongArray(A_MAX + 1) { -1L }
    minFactor[0] = 0L
    minFactor[1] = 1L
    for (i in 2..A_MAX) {
        if (minFactor[i] == -1L) {
            minFactor[i] = i.toLong()
            for (j in i * 2..A_MAX step i) {
                if (minFactor[j] == -1L) {
                    minFactor[j] = i.toLong()
                }
            }
        }
    }

    val factorCount = mutableMapOf<Long, Long>()
    for (A in AArr) {
        var tmp = A
        val factorTmp = mutableMapOf<Long, Long>()
        while (tmp != 1L) {
            val factor = minFactor[tmp.toInt()]
            val cnt = factorTmp[factor] ?: 0L
            factorTmp[factor] = cnt + 1L
            tmp /= factor
        }
        factorTmp.forEach { e ->
            factorCount[e.key] = Math.max(factorCount[e.key] ?: 0, e.value)
        }
    }

    var lcm = 1L

    factorCount.forEach { e ->
        for (i in 1..e.value) {
            lcm *= e.key
            lcm %= mod
        }
    }

    var ans = 0L

    for (A in AArr) {
        ans += lcm * inverse[A.toInt()] % mod
        ans %= mod
    }

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}
