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