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;
    }
    for(let num of arr){
        count *= num;
        if(count > BigInt(1000000000000000000)){
            console.log(-1);
            return;
        }
    }    
    console.log(Number(count));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
