import java.math.BigInteger

fun main(){
    readLine()
    val input = readLine()!!.split(" ").map { it.toLong() }
    var result:BigInteger = BigInteger.valueOf(1)
    val max:BigInteger = BigInteger.valueOf( 1000000000000000000)

    if (input.isEmpty()){
        println(0)
        return
    }
    if (input.contains(0)) {
        println(0)
        return
    }
    input.forEach {
        result = result.multiply(BigInteger.valueOf(it))
        if (result > max) {
            println(-1)
            return
        }
    }
    println(result)
}
