import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val MOD = 1e9.toInt + 7

  val N = in.next().toInt
  val A = new Array[Int](N+1)
  for (i <- 1 to N)
    A(i) = in.next().toInt

  //
  // 素数とその個数の組のリストを返す
  def primeFactorization(n: Long): Map[Long, Int] = {
    var rest = n
    val res = Map[Long, Int]()

    var i = 2L
    while (i * i <= n) {
      var cnt = 0
      while (rest % i == 0) {
        cnt += 1
        rest /= i
      }

      if (cnt > 0)
        res += (i -> cnt)

      i += 1
    }
    if (rest > 1)
        res += (rest -> 1)

    res
  }

  val lcm = Map[Long, Int]()
  for (i <- 1 to N) {
    val hoge = primeFactorization(A(i))
    for ((p, num) <- hoge) {
      if (!lcm.contains(p))
        lcm += (p -> num)
      else
        lcm(p) = Math.max(lcm(p), num)
    }
  }

  var ans = 0L
  for (i <- 1 to N) {
    val hoge = primeFactorization(A(i))
    var tmp = 1L
    for ((p, num) <- lcm) {
      val n =
        if (!hoge.contains(p))
          num
        else {
          num - hoge(p)

        }
      tmp *= Math.max(1L, n * p)
      tmp %= MOD
    }

    ans += tmp
  }

  println(ans)
}

object Sub {
  def print2DimArray[A](mat: Array[Array[A]]): Unit = {
    mat.foreach(lin => println(lin.toList))
  }
}

class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
