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(_.toLong)

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

  println(solve())

}

