function main(input){
    var inp = input.trim();
    var inpArray=inp.split('\n');
    var n = parseInt(inpArray[0]);
    var numArray = inpArray[1].split(' ');
    var out = 1 / 1000000000;
    for(i=0;i<n;i++){
        out = out * parseInt(numArray[i]);
        if(out>1000000000){
            out=-1;
            break;
        }
    }
    for(i=0;i<n;i++){
        if(parseInt(numArray[i])==0){
            out=0;
            break;
        }
    }
    console.log(out);
     
}
     
    main(require("fs").readFileSync("/dev/stdin", "utf8"));