import           Data.List (foldl')

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