import scala.math.pow

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt

  val ary = List.fill(N)(sc.nextLong)

  val product = ary.product

  if (product > pow(10,18).toLong){
    println(-1)
  }
  else{
    println(product)
  }
}
