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