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) {
      var temp = res * a
      if (pow(10, 18).toLong < temp) {
        res = -1L
        b.break
      } else {
        res = res * a
      }
    }
  }
  if (as.contains(0L)) {
    println(0)
  } else {
    println(res)
  }
}

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