import java.util.*
fun main(args : Array<String>){
    val sc=Scanner(System.`in`)
    val arr = arrayOf<Int>()
    var n=sc.nextInt()
    var ans:Int=1
    for(i in 0..n)
    {
       arr[i]=sc.nextInt()
       ans=ans*arr[i]
    }
    if(ans>1000000000000000000)
    {
        println(-1)
    }
    else
    {
        println(ans)
    }
   
 }
