import Data.List

main = do
  getLine
  li <- getLine
  let as = map read $ words li
  let ans = compute as
  print ans

d :: Integer
d = 1000000007

compute :: [Integer] -> Integer
compute as = foldl1' f bs
  where
    x = foldl1' lcm as
    bs0 = map (div x) as
    y = foldl1' gcd bs0
    bs = map (flip div y) bs0
    f a b = (a + b) `mod` d
