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

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

    for (i <- InputArray) {
      if (i == 0) {
        println(0);
        return;
      }
      answer = answer * i;
    }

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

    println(0);
    return
  }
}
