import java.math.BigInteger
import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt

  val limit = BigInt("1000000000000000000")

  @tailrec def lp(acc: BigInt, cnt: Int): BigInt = {
    if (acc > limit) {
      BigInt(-1)
    } else if (cnt == 0) {
      acc
    } else {
      lp(acc * BigInt(sc.nextBigInteger), cnt - 1)
    }
  }

  println(lp(BigInt(BigInteger.ONE), N))
}
