import java.util.Scanner
import scala.util.control.Breaks

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = Array.fill(N)(sc.nextLong)

  val z = if (A.contains(0)) 0 else {
    val b = new Breaks
    var x = 1L
    b.breakable {
      for (i <- 0 until N) {
        x *= A(i)
        if (x < 0 || x > 1000000000000000000L) {
          x = -1
          b.break
        }
      }
    }
    x
  }
  println(z)
}
