import Foundation


func solution() -> Int {
   let N = Int(readLine()!)!
   let AList:[Int] = readLine()!.components(separatedBy: " ").map { Int($0)! }
   let upper = Int(pow(10.0, 18.0))
   var upperFlag = false
   
   if AList.contains(0) { return 0}
   
   let result = AList.reduce(1) { (num1, num2) -> Int in
      if num1 * num2 > upper {
         upperFlag = true
         return 0
      }
         
      return num1 * num2
   }
   
   if upperFlag { return -1}
   return result
}

print(solution())
