A person started the ritual washing (ghusl) for purification but had to stop due to cold water. They washed their head and neck, then turned off the water because it became too cold. After a while, they resumed and completed the washing of the right and left sides of their body. Is their ghusl valid?