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

  const res = a.reduce((acc, n) => acc * n);

  console.log(res > BigInt(10) ** BigInt(18) ? -1 : res.toString());
}


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



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