func readInt() -> Int {
    return Int(readLine()!)!
}

func readArrayInt() -> [Int] {
    readLine()!.split(separator: " ").map({Int($0)!})
}

let N = readInt()
let threshold = Int(1e18)
var valid = true
var ans = 1
let A = readArrayInt().sorted()

if A[0] == 0 {
    print(0)
} else {
    for a in A {
        if (a > (threshold / ans)) {
            valid = false
            break
        }
        ans *= a
    }
    print(valid ? ans : -1)
}
