output_description: If Takahashi's submission gets an AC, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
attempt: #
  
  import sys
  
  input = sys.stdin.readline
  
  kl = set()
  
  
  def pf(n):
      ret = {}
      for i in range(2, int((n) ** 0.5) + 1):
          if n % i == 0:
              cnt = 0
              while n % i == 0:
                  n /= i
                  cnt += 1
              ret[i] = cnt
              kl.add(i)
      if n != 1:
          ret[int(n)] = 1
          kl.add(int(n))
      return ret
  
  
  def main():
      N = int(input())
      A = list(map(int, input().split()))
      if N == 1:
          print(1)
          exit()
      p = [{} for i in range(N)]
      for i in range(N):
          p[i] = pf(A[i])
      lcm = 1
      for i in kl:
          maxipow = 0
          for j in range(N):
              maxipow = max(maxipow, p[j].get(i, 0))
          lcm *= i**maxipow
      MOD = 10**9 + 7
      lcm %= MOD
      ans = 0
      for i in range(N):
          ans += lcm * pow(A[i], MOD - 2, MOD)
          ans %= MOD
      print(ans)
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  Takahashi is participating in a programming contest, AXC001. He has just
  submitted his code to Problem A.  
  The problem has N test cases, all of which must be passed to get an AC
  verdict.  
  Takahashi's submission has passed M cases out of the N test cases.  
  Determine whether Takahashi's submission gets an AC.
samples: [{"input": "3 3", "output": "Yes\n    \n\nAll three test cases have been passed, so his submission gets an AC.\n\n* * *"}, {"input": "3 2", "output": "No\n    \n\nOnly two out of the three test cases have been passed, so his submission does\nnot get an AC.\n\n* * *"}, {"input": "1 1", "output": "Yes"}]