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

    const result = arr.reduce((a,b) => a*b);
    if(result > Math.pow(10,18)){
        console.log(-1);
    }else{
        console.log(result);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));