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

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

  var res = 1L
  val b = new scala.util.control.Breaks
  b.breakable {
    for (a <- as) {
      res = res * a
      if (1000000000000000000L < res) {
        res = -1L
        b.break
      }
    }
  }

  println(res)
}

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