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