function main(lines) {
  const N = lines[0];
  const a = lines[1].split(' ').map(BigInt);

  if (a.includes(BigInt(0))) return console.log(0);
  let res = BigInt(1);
  for (let i = 0; i < N; i++) {
    res *= a[i];
    if (res > BigInt(10) ** BigInt(18)) {
      res = BigInt(-1);
      break;
    }
  }

  console.log(res.toString());
}


main( require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n") );



function splitN(s) {
  return s.split(' ').map(Number);
}