function main(input) {
  const inputs = input.split('\n')
  // const N = Number(inputs[0])
  const Ai = inputs[1].split(' ').map(BigInt)
  if (Ai.includes(0n)){
    console.log(0)
    return
  }
  const l = Ai.length

  // const start = new Date()

  let r = 1n
  for(let i = 0; i < l; i++) {
    r *= Ai[i]
    if (r > 1000000000000000000n) {
      break
    }
  }
  if (r > 1000000000000000000n) {
    console.log(-1)
  } else {
    console.log(r.toString())
  }

  // const end = new Date()
  // console.log(end - start)
}

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