let N = Int(readLine()!)!
let inputs = readLine()!
let nums = inputs.components(separatedBy: " ")
var total = Int(nums[0])!
var a = false

for i in 1...N - 1 {
    if Int(nums[i])! == 0 {
        print("0")
        a = true
        break
    }
}

if a != true {
    for i in 1...N - 1 {
        total *= Int(nums[i])!
        if total > 1000000000000000000 {
        print("-1")
        } else if i == N - 1 {
            print(total)
        }
    }
}