object Main extends App {
  import scala.io.StdIn._
  val n = readLong()
  val a = readLine.split(" ").map(_.toLong)
  val res = a.foldLeft(1L) { (x: Long, y: Long) => x * y }
  println(if (res > 1000000000000000000L) -1 else res)
}