function main(input) {
  const inputs = input.split('\n')
  const N = Number(inputs[0])
  const Ai = inputs[1].split(' ').map(BigInt)
  const r = Ai.reduce((a, b) => {
    return a * b
  }, 1n)
  // console.log(r, r > 1000000000000000000n)

  if (r > 1000000000000000000n) {
    console.log(-1)
  } else {
    console.log(r.toString())
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
