fun main(){
    val n = readLine()!!.split(" ")[0].toInt()
    val a = readLine()!!.split(" ").map { it.toLong() }
    var ans = 1L
    var flag = 0
    for (i in 0 until n){
        ans *= a[i]
        if (ans > 1000000000000000000) {
            flag = 1
            break
        } else if (ans < 0){
            flag = 1
            break
        }
    }
    var x = 1000000000000000000
    for (i in 0 until n){
        x /= a[i]
        if (x == 0L) {
            flag = 1
            break
        }
    }
    for (i in 0 until n){
        if (a[i] == 0L) {
            flag = 2
            break
        }
    }
    if (flag == 2) println(0)
    else if (flag == 1) println(-1)
    else println(ans)
}
