function Main(input){
  const values = input.trim().split('\n');
  const N = parseInt(values[0]);
  const A = values[1].split(' ').map((str)=> BigInt(str));
  var result = BigInt('1');
  const max_result = BigInt('1000000000000000000');
  var flg = 1;
  
  for(var data of A){
    result *= data;
  }
  
  if(result > max_result){
    result = -1;
  }
  console.log(String(result));
}

//固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));