object Main extends App{
    val n = io.StdIn.readInt
    val a = io.StdIn.readLine.split(" ").map(_.toLong)
    
    val upper  = BigDecimal(10).pow(18)
	val a_bd = a.map(BigDecimal(_))
  	val output = a_bd.reduce(_ * _)
  
    if (upper < output) println(-1) else println(output)
}
