import Foundation


func solution() -> String {
   _ = readLine()
   let AB = readLine()!.components(separatedBy: " ").map { Int($0)! }
   var UpperFlag = false
   
   if AB.contains(0) { return "0" }
   
   let result = AB.reduce(1) { (num1, num2) -> Int in
      
      if num1 * num2 > Int(pow(10.0, 18.0)) {
         UpperFlag = true
         return 0
      }
      
      return num1 * num2
   }
   
   if UpperFlag {
      return "-1"
   }
   return String(result)
}


print(solution())