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

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

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

for a in A {
    ans *= a
    if ans > threshold {
        break
    }
}

print(ans > threshold ? -1 : ans)
