import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  @tailrec def lp(acc: BigInt, cnt: Int): Unit = {
    if (cnt == 0) {
      println(if (acc > BigInt("1000000000000000000")) "-1" else acc)
    } else {
      val n = acc * BigInt(sc.next)
      lp(n, cnt - 1)
    }
  }

  lp(BigInt(1), N)
}
