object Main extends App {

  import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

  val in = new BufferedReader(new InputStreamReader(System.in))
  val out = new PrintWriter(new BufferedOutputStream(System.out))
  var ans = BigInt(1)
  var flag = false
  var flag2 = false
  val n = in.readLine().toInt
  in.readLine().split(" ").map(x => if (BigInt(x) == 0) flag = true else if (ans * BigInt(x) > 1000000000000000000L) flag2 = true else ans *= BigInt(x))
  out.println(if (flag) 0 else if (flag2) -1 else ans)
  out.flush()
}