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