const rl = require("readline").createInterface(process.stdin,process.stdout);

let count = 1
let input1, sum
const b = Math.pow(10, 18)
rl.on("line", (input) => {
    if(count === 1) {
        input1 = Number(input)
    } else {
        const args = input.split(" ")
        sum = args[0]
        for (let i = 1; i < input1; i++) {
            sum = sum * args[i]
        }

        if(sum > b) {
            console.log(-1)
        } else {
            console.log(sum)
        }

        process.exit()
    }
    count++
});
