fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toLong() }
    if(a.contains(0L)) {
        println(0); return
    }
    var ans = 1L
    var d = 1.0
    a.forEach {
        d *= it.toDouble()
        ans *= it
        if(d > 2e18){
            println(-1); return
        }
    }
    if(ans > 1e18.toLong()) println(-1) else println(ans)
}