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

moduloN = 10 ^ 9 + 7

modN = flip mod moduloN

main = do
    getLine
    as <- getIntList
    let m = foldr lcm 1 as
    print . foldr (\x y -> modN (x + y)) 0 $ map (\x -> modN (m `div` x)) as