import java.util.Scanner

object Main extends App {
  val sc     = new Scanner(System.in)
  val n      = sc.nextInt()
  var isOver = false
  var s      = BigInt(1)
  while (sc.hasNext && !isOver && s != 0) {
    val a = BigInt(sc.next())
    val x = s * a
    if (x <= 1_000_000_000_000_000_000L) {
      s = x
    } else {
      isOver = true
    }
  }

  println(if (isOver) -1 else s)
}
