function Main(input) {
  input = input.split("\n");
  const N = input[0].trim();
  const values = input[1].split(" ");

  for (let i=0;i<N;i++) {
    if (values[i] == 0) {
    	console.log(0)
	    return
    }
  }
  
  const n = BigInt(1000000000000000000);
  let result = BigInt(1);
  for (let i=0;i<N;i++) {
    const nextVal = BigInt(values[i]);
    
    if (nextVal > n) {
      console.log("-1");
      return
    }
    
    result = result * nextVal;
    
    if (result > n) {
    	console.log("-1");
        return
    }
  }

  console.log(Number(result));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));