output_description: Print the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that
  satisfy the condition, modulo (10^9 +7).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 ... A_N
attempt: def gcd(m, n):
      if m == 0:
          return n
      if n == 0:
          return m
      if m > n:
          return gcd(m - n, n)
      return gcd(n - m, m)
  
  
  # a**n(mod m)を返す
  def pow_mod(a, n, m):
      tmp = 1
      a_power = a
      nn = n
      while 1:
          if nn % 2:
              tmp = (tmp * a_power) % m
          a_power = (a_power * a_power) % m
          nn = nn // 2
          if nn == 0:
              break
      return tmp
  
  
  # a**-1 (mod p) p must be prime
  def inv_mod(a, p):
      return pow_mod(a, p - 2, p)
  
  
  # lcm(arr) mod p
  def lcm_mod(arr, p):
      arr2 = [arr[0]]
      for i in range(1, len(arr)):
          res = arr[i]
          for a in arr2:
              res = res // gcd(res, a)
              if res == 1:
                  break
          if res != 1:
              arr2 += [res]
      prod = 1
      for a in arr2:
          prod = prod * a % p
      return prod
  
  
  N = int(input())
  arr = list(map(int, input().split()))
  b = 10**9 + 7
  
  lcm = lcm_mod(arr, b)
  
  tmp = 0
  for a in arr:
      tmp += (lcm * inv_mod(a, b)) % b
  
  print(tmp)
  
problem_description: Statement
  
  Given are N positive integers A_1,...,A_N.
  
  Consider positive integers B_1, ..., B_N that satisfy the following condition.
  
  Condition: For any i, j such that 1 \leq i < j \leq N, A_i B_i = A_j B_j
  holds.
  
  Find the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.
  
  Since the answer can be enormous, print the sum modulo (10^9 +7).
samples: [{"input": "3\n    2 3 4", "output": "13\n    \n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\n* * *"}, {"input": "5\n    12 12 12 12 12", "output": "5\n    \n\nWe can let all B_i be 1.\n\n* * *"}, {"input": "3\n    1000000 999999 999998", "output": "996989508\n    \n\nPrint the sum modulo (10^9+7)."}]