function Main(input) {
  const [number, numbers] = input.split('\n')
  const ns = numbers.split(' ').map(v => parseInt(v))
  const max = 1e+18
  
  const multi = ns.reduce((accm, number) => {
    accm *= number
    return accm
  }, 1)

  if (multi > max) {
    console.log(-1)
  } else {
    console.log(multi)    
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));