"use strict";

const main = arg => {
    const input = arg.trim().split("\n");
    const n = parseInt(input[0]);
    const arr = input[1].split(" ").map(item => BigInt(item));

    let ret = 1
    for(let item of arr){
        if(item == 0){
            console.log(0)
            return
        }
        ret = ret*item
        if(ret > 10**18){
            console.log(-1)
            return
        }
    }
    console.log(ret)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  