import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  val n = scala.io.StdIn.readInt()
  val A = scala.io.StdIn.readLine().split(" ").map(BigInt(_))

  def solve(): BigInt = {
    val limit = BigInt(1000000000000000000L)
    val product = A.product
    if(product > limit) BigInt(-1) else product
  }

  println(solve())

}

