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 = 1L
  var flag = false
  var flag2=false
  val n = in.readLine().toInt
  in.readLine().split(" ").map(x => if(x.toLong == 0)flag=true else if(ans * x.toLong > 1E+18 || ans * x.toLong <= 0) flag2=true else ans *= x.toLong)
  out.println(if(flag) 0 else if(flag2) -1 else ans )
  out.flush()
}
