function Main(input){
    const arr = input.trim().split('\n')[1].split(' ').map(BigInt);

    let count = 1n;
    if(arr.includes(0n) >0){
        console.log(0);
        return;
    }
    arr.map(a =>count *=  a);

    if(count > BigInt(10**18)){
        console.log(-1);
    }else{
        console.log(Number(count));
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));