import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    getLine
    as <- getIntList
    let ass = map factorization as
    let lcmNum = foldl lcmPrime [] ass
    print . flip mod 100000007 . sum $ map (product . (lcmNum `pdiv`)) ass

factorization :: Int -> [Int]
factorization 1 = []
factorization n = (p :) . factorization $ n `div` p
    where p = head [m | m <- [2..n], n `mod` m == 0]

lcmPrime :: [Int] -> [Int] -> [Int]
lcmPrime xs [] = xs
lcmPrime [] ys = ys
lcmPrime (x : xs) (y : ys) | x == y = x : lcmPrime xs ys
                           | x < y = x : lcmPrime xs (y : ys)
                           | x > y = y : lcmPrime (x : xs) ys

pdiv :: [Int] -> [Int] -> [Int]
pdiv xs [] = xs
pdiv (x : xs) (y : ys) | x == y = pdiv xs ys
                       | otherwise = x : pdiv xs (y : ys)
