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

    let count = 1;
    arr.map(a =>count = BigInt(count) * BigInt(a));

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