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