import           Data.List (foldl')

main :: IO ()
main = do
  _ <- getLine
  as <- getLine
  let a = foldl' (\a b -> a * read b) 1 . words $ as
      b = if a > u
          then -1
          else a
      u = 10 ^ 18
  print b
