import scala.math


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