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

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

  if (as.contains(0L)) {
    println(0)
  } else {
    var res = BigInt(1)
    val b = new scala.util.control.Breaks
    b.breakable {
      for (a <- as) {
        var temp = res * BigInt(a)
        if (BigInt(pow(10, 18).toLong) < temp) {
          res = BigInt(-1)
          b.break
        } else {
          res = res * a
        }
      }
    }
    println(res)
  }
}

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