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] = BigInt(ary[n]);
    }
    
    var count = BigInt(1);
    var flg = 0;
    
    if(ary.includes(BigInt(0))){
        console.log("0");
    }else{
        for(var i=0; i<num; i++){
            count = count * ary[i];
            if(count>BigInt(Math.pow(10,18))){
                flg = 1;
                console.log("-1");
                break;
            }
        }
        if(flg===0){
            console.log(String(count));
        }
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));