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

func main() {
    let _ = readLine()!
    let a_tachi = readInts()
    
    for i in 0..<(a_tachi.count) {
        if a_tachi[i] == 0 {
            print("0")
            return
        }
    }
    
    var ans = 1
    for i in 0..<(a_tachi.count) {
        ans *= a_tachi[i]
        if ans > 1000000000000000000 {
            print("-1")
            return
        }
    }
    print(ans)
}

main()
