function Main(input) {
    var tmp = input.split("\n");
    var num = parseInt(tmp[0]);
    var ary = tmp[1].split(" ");
    
    for(var n=0; n<num; n++){
        ary[n] = parseInt(ary[n]);
    }
    
    var count = BigInt(1);
    
    loop:
    if(ary.includes(0)){
        console.log(0);
    }else{
        for(var i=0; i<num; i++){
            count = count * BigInt(ary[i]);
            if(count>BigInt(Math.pow(10,18))){
                console.log(-1);
                break loop;
            }
        }
        console.log(Number(count));
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));