function Main(input){
    input=input.split("\n");  //ここまで必須
    var line=input[1].split(" ");
    var result=1;
    for (i=0;i<input[0];i++){
        result=parseInt(result)*parseInt(line[i]);
    }
    if (result>Math.pow(10,18)){console.log(-1)} else{console.log(result)}
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));