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
    k <- getInt
    as <- getIntList
    let (nmin,nmax) = foldr f (2,2) as
    putStrLn $ if nmin == -1 then "-1" else show nmin ++ " " ++ show nmax

f a (nmin,nmax) | nmin' > nmax' = (-1, -1)
                | otherwise = (nmin', nmax')
                    where nmin' = ((nmin - 1) `div` a + 1) * a
                          nmax' = (nmax `div` a + 1) * a - 1