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