import java.util.Scanner

import scala.io.StdIn._

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

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