import scala.io.StdIn._
import scala.math._

object Main extends App with StdInHelper {
  val n = readInt
  val as = readLongs

  val res = as.foldLeft(1L)(_ * _)

  if (100000000000000000L < res) {
    println("-1")
  } else {
    println(res)
  }
}

trait StdInHelper {
  def readInts = readLine.split(" ").map(_.toInt)
  def readLongs = readLine.split(" ").map(_.toLong)
}
