import scala.math

object Main extends App {
  val n = io.StdIn.readLine().split(' ')
  val A = (io.StdIn.readLine().split(' ')).map(_.toInt)
  var mult:Long = 1
  for (i <- A){
    mult *= i 
    }
  if (mult > math.pow(10,18) | mult < 0) println("-1")      
  else println(mult)
}