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

func main() {
    let _ = readLine()!
    let a_tachi = readUInts().sorted(by: <)
    
    if a_tachi[0] == 0 {
        print(0)
        return
    }
    
    var mul: UInt = 1
    for a in a_tachi {
        if 1000000000000000000 / mul < a {
            print(-1)
            return
        }
        mul *= a
        if mul > 1000000000000000000 {
            print(-1)
            return
        }
    }
    
    print(mul)
}

main()
