import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func toTuple<T>(_ args: [T]) -> (T, T, T) { (args[0], args[1], args[2]) }
func toTuple<T>(_ args: [T]) -> (T, T, T, T) { (args[0], args[1], args[2], args[3]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }
func readDoubles() -> [Double] { readLine()!.split(separator: " ").map { Double($0)! } }

let _ = readLine()!
let ai = readInts()
if ai.contains(0) {
  print(0)
} else {
  var r = 1
  for i in 0..<ai.count {
    r &*= ai[i]
    if r < 0 || r > 1_000_000_000_000_000_000 {
      print(-1)
      exit(0)
    }
  }
  let result = ai.reduce(1){$0 * $1}
  print(result)
}