console.log(
  [
  require("fs")
  .readFileSync("/dev/stdin", "utf8")
  .split("\n")[1]
  .split(" ")
  .reduce(
    (acc, sum) => BigInt(sum) * BigInt(acc),
    BigInt(1)
  )
  ].map(n => n > 10**18 ? -1 : n).join()
)