// Multiplication 2

func main() {
    let _ = Int(readLine()!)!
    let a = readLine()!.split(separator: " ").map{Int($0)!}
    if a.contains(0) {
        print(0)
        return
    }
    var result = 1
    for ai in a {
        result *= ai
        if result > 1000000000000000000 {
            print(-1)
            return
        }
    }
    print(result)
}

main()