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

for i in 1...N - 1 {
    total *= Int(nums[i])!
}

if total > 1000000000000000000 {
    print("-1")
} else {
    print(total)
}