object Main extends App {
  val n =  scala.io.StdIn.readInt()
  val d = scala.io.StdIn.readLine()
  val dArray = d.split(" ").map(_.toLong).toVector
  if(dArray(0) != 0L) {
    println(0)
  } else {
    println(dArray.tail.foldLeft(1L) { case (sum, d) => sum * d })
  }
}