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

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