const main = (input) => {
  const [N, n] = input.trim().split('\n')
  const LIMIT = BigInt(Math.pow(10, 18))
  const nums = n.trim().split(' ').map(v => parseInt(v, 10)).sort((a, b) => a - b)

  if (nums[0] === 0) {
    console.log(0)
    return null
  }

  let ans = BigInt(1)
  for (let v of nums) ans = ans * BigInt(Number(v))

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

process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))