const main = stdin => {
  const input = stdin.trim().split('\n')
  const N = parseInt(input[0])
  const nums = input[1].split(' ').map(x => BigInt(x))
  if (nums.includes(0n)) {
    console.log(0)
    return
  }

  let ans = 1n
  for (let i = 0; i < N; i++) {
    ans = ans * nums[i]
    if (ans > 1000000000000000000n) {
      console.log(-1)
      return
    }
  }
  console.log(ans.toString())
}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
