fun main() {

    val n = readLine()!!.toInt()

    val list = readLine()!!.split(" ").map(String::toLong)

    var ans: Long = 1

    if (list.contains(0)){
        println(0)
        return
    }

    for (i in 0..n-1){
        if (list[i]<=1000000000000000000/ans){
            ans *= list[i]
        } else {
            ans = -1
        }
    }

    println(ans)

}