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) | a > nmax = (-1, -1)
                | otherwise = (nmin', nmax')
                    where a' = (nmax `div` a) * a
                          a'' = (nmin ` div` a + 1) * a
                          nmin' = min a' a''
                          nmax' = a' + a - 1 