object Main {
  def main(args: Array[String]): Unit ={
    import java.io.{
      BufferedReader,
      InputStreamReader,
    }
    val in = new BufferedReader(new InputStreamReader(System.in))

    val N = in.readLine().toLong;
    val InputArray = in.readLine().split(" ").map(x => BigDecimal(x));
    var answer = BigDecimal("1");

    for (i <- InputArray) {
      answer *= i;
    }

    if (answer > 1000000000000000000L) {
      println(-1);
      return;
    }

    println(answer);
  }
}