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

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt()
    val a = Vector.fill(n)(sc.nextBigInteger())

    val l = BigInt.apply("1000000000000000000")

    val ans = a.foldLeft(BigInteger.ONE) { case (z, i) => z.multiply(i) } match {
      case x if l < x => BigInteger.valueOf(-1L)
      case x => x
    }

    println(ans)
  }

}
