import java.math.BigInteger
import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val As = Seq.fill(N)(BigInt(sc.nextLong))

  val limit = BigInt("1000000000000000000")

  if (As.contains(BigInt(BigInteger.ZERO))) {
    println(0)
  } else {
    println(loop(BigInt(BigInteger.ONE), As))
  }

  @tailrec def loop(acc: BigInt, li: Seq[BigInt]): BigInt = li match {
    case _ if acc > limit => BigInt(-1)
    case head +: tail => loop(acc * head, tail)
    case _ => acc
  }

}
