import java.lang.Math.pow
import java.math.BigInteger

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

private fun readLong() = readLn().toLong() // single int
private fun readLongs() = readStrings().map { it.toLong() }

fun main(){
    val n = readInt()
    val numList = readLongs()

    //var ans: Long = 1
    var ans: BigInteger = BigInteger.valueOf(1)
    val limit: Long = pow(10.0, 18.0).toLong()

    if(numList.contains(0)){
        ans = BigInteger.valueOf(0)
    }else{
        for(i in numList){
            ans *= BigInteger.valueOf(i)
            if(ans > BigInteger.valueOf(limit)){
                ans = BigInteger.valueOf(-1)
                break
            }
        }
    }

    println(ans)
}

