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

if nums.contains(0) {
  print(0)
} else {
  for i in 0..<N {
    if String(product).count + String(nums[i]).count - 1 > 19 {
   	  product = -1
      break
    }
    product *= nums[i]
    if product > 1000000000000000000 {
      product = -1
      break
    }
  }
  print(product)
}