let N = Int(readLine()!)!
var product = 1
let nums: [Int] = readLine()!.split(separator: " ").map { Int($0)! }
let threshold = 1000000000000000000

if nums.contains(0) {
  print(0)
} else {
  for i in 0..<N {
    if Double(nums[i]) > Double(threshold) / Double(product) {
      product = -1
      break
    }
    product *= nums[i]
    if product > threshold {
      product = -1
      break
    }
  }
  print(product)
}