Can i pray namaz after a haircut done by kafir wherein water has been used by her or is it necessary to wash my hair before praying?

Was the person touching your wet hair from the people of the book (Jew or Christian)? Or were they an atheist or hindu for example?