By Definition of Kinetic Energy, it is valid:

Using the Torricelli's Equation in vertical direction on the maximum height, remember that the final velocity at this point is zero, we have:

If you notice any mistake in my english, please let me know, because my english level is still low.