import Foundation

func solution() -> String {
   _ = readLine()
   var AList = readLine()!.components(separatedBy: " ").map { Int($0)! }
   
   AList.sort { $0 > $1 }
   
   if AList.last! == 0 { return "0" }
   
   var result = 1
   for tmp in AList {
      result *= tmp
      if result > Int(pow(10.0, 18.0)) { return "-1" }
   }
   
   return String(result)
}

print(solution())