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

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