import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val result = Seq.fill(N)(BigInt(sc.next)).product
  println(if (result > BigInt("1000000000000000000")) "-1" else result)
}
