object Main extends App{
  val sc = new java.util.Scanner(System.in)
  var n = sc.nextInt()
  val a = Array.fill(n)(sc.nextLong())
  a.sortWith(_ < _)
  var num :Long = 1
  if (a(0) == 0) {print(0);sys.exit()}
  for (i <- 0 until n){
    if (! (1000000000000000000L/num >= a(i))){ print(-1);sys.exit()};else{num*=a(1)}
  }
  println(num)
}