"use strict"
function main(arg) {
    let data = arg.trim().split("\n")[1].split(" ").map(e => BigInt(e))
    let boundary = BigInt(Math.pow(10, 18))
    // let boundary = BigInt(1000000000000000000)
    let sum = BigInt(1)
    // let ans = 0
    if (data.includes(BigInt(0))) {
        console.log(0)
        return;
    }
    for (let i = 0; i < data.length; i++) {
        sum *= data[i]
        if (boundary < sum) {
            sum = -1
            break
        }
    }
    console.log(sum)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));