import Data.List

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

d :: Int
d = 1000000007

compute :: [Int] -> Int
compute as = foldl' f 0 (map (div x) as)
  where
    x = foldl' lcm 1 as
    f a b = (a + b) `mod` d
