import scala.math._

object methods {
  def solver: Unit = {

    val tempList: Seq[Seq[String]] = {
      for(line <- io.Source.stdin.getLines()) yield {
        line.split(' ').toSeq
      }
    }.toSeq

    val N: Int = tempList(0)(0).toInt
    val ASeq: Seq[Long] = tempList(1).map(_.toLong)

    var i = 0
    var Multiple: Long = 1L
    var flag: Boolean = true
    while(i < N){
      Multiple = Multiple * ASeq(i)
      if(Multiple > pow(10, 18).toLong){
        i = N
        flag = false
      }
      i += 1
    }

    if(flag) println(Multiple) else println(-1)

  }
}

object main extends App {
  methods.solver
}