import java.lang.Math

const val MOD = 1000000007L

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val a = readLine()!!.split(" ").map { it.toLong() }.toLongArray()
  val r = Math.sqrt(0.5+a.max()!!).toLong()
  var s = 0L
  for (i in 0 until n) s = (s+inv(a[i]))%MOD
  for (p in 2L..r) {
    var m = 0
    for (i in 0 until n) {
      var t = 0
      while (a[i]%p == 0L) {
        a[i] /= p
        t++
      }
      m = Math.max(m,t)
    }
    s = (s*pow(p,m))%MOD
  }
  for (p in a.filter { it != 1L }.toSet()) s = (s*p)%MOD
  println(s)
}

fun pow(a: Long, b: Int): Long {
  var p = 1L
  var m = a
  var k = b
  while (k > 0) {
    if ((k and 1) == 1) p = (p*m)%MOD
    m = (m*m)%MOD
    k = k shr 1
  }
  return p
}

fun inv(n: Long): Long {
  var a = (n%MOD+MOD)%MOD
  var b = MOD
  var c = 0L
  var x = 1L
  while (b != 0L) {
    val p = a/b
    var q = b
    b = a%b
    a = q
    q = x
    x = c
    c = q-p*c
  }
  return (x%MOD+MOD)%MOD
}