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)(sc.nextLong)
  if (As.contains(0L)) {
    println(0)
  } else {
    lp(1L, As)
  }

  @tailrec def lp(acc: Long, li: Seq[Long]): Unit = li match {
    case head +: rest =>
      if (Math.log10(acc) + Math.log10(head) > 18d) {
        println(-1)
      } else {
        lp(acc * head, rest)
      }
    case _ =>
      println(acc)
  }
}
