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(a.contains(0)) println(0)
    else{
      if (upper < output) println(-1)
  	  else println(output)
    }
}
