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)! } }

_ = readLine()!
let ai = readInts()
if ai.contains(0) {
  print(0)
  exit(0)
}
var result = 1
for a in ai {
  result &*= a
  if result < 0 || result > 1_000_000_000_000_000_000 {
    print(-1)
    exit(0)
  }
}
print(result)