import java.math.BigDecimal
import java.math.BigInteger

fun main() {
    val n = readLine()!!.toInt()
    val lList = readLine()!!.split(" ").map(String::toBigInteger)

    val slList = lList.sorted()

    var result = BigInteger.ONE
    run loop@{
        slList.forEach{
            if(it == BigInteger.ZERO){
                result = BigInteger.ZERO
                return@loop
            }else{
                result = result.times(it)
                if(result > 1000000000000000000.toBigInteger()){
                    result = (-1).toBigInteger()
                    return@loop
                }
            }
        }
    }

    println(result)
}