function Main(input) {
    input = input.split("\n");
  //const temp = input.split(" ");
    const num = input[1].split(" ").map(num => Number(num));
  if (num.filter(a => a === 0).length > 0){
      console.log(0);
  } else {
      let sum = 1;
      num.sort(function(a,b){
          return b-a;
      });
      for(var i = 0; i < num.length; i++){
          if(sum * num[i] > Math.pow(10, 18)){
              console.log(-1);
              break;
          }
          else {
              sum = BigInt(sum) * BigInt(num[i]);
          }
      }
  console.log(BigInt(sum) > Math.pow(10, 18) ? -1 : BigInt(sum));
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));