const main = (input) => {
  input = input.trim().split('\n')
  const arr = input[1].split(' ').sort((a, b) => BigInt(b) - BigInt(a)).map(BigInt)

  if (arr.includes(0n)) return console.log(0)

  let ans = 1n
  for (let i=0; i<arr.length; i++) {

    ans *= arr[i]

  }
  return console.log(ans > BigInt(10**18) ? -1 : `${ans}`)
}

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