import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val A = Array.fill(N)(BigInt(sc.nextLong))

  val z = A.foldLeft(BigInt(1))((z, x) => z * x)
  println(if (z > BigInt(1000000000000000000L)) -1 else z)
}
