const main = input => {
  const r = input.trim().split("\n")[1].split(" ").map(e => BigInt(e)).reduce((a, c) => a * c, 1n)
  if (r > 10n ** 18n) return -1
  return r.toString()
}

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