import java.math.BigDecimal

fun main(args: Array<String>){
    val N = readLine()!!.toInt()

    val A = readLine()!!.split(" ").map{it.toBigDecimal()}



    if(BigDecimal(0)in A){
        println(0)
        return
    }

    var total = A[0]
    val max = BigDecimal(10).pow(18)

    for(i in 1 until N){
        total *= A[i]
        if(total > max){
            total = BigDecimal(-1)
            break
        }
    }

    println(total)


}