Sahih Bukhari Volume 002, Book 026, Hadith Number 781.
Narated By Ibn Abbas : The Prophet was asked by a man who said, "I have done the Rami in the evening." The Prophet replied, "There is no harm in it." Another man asked, "I had my head shaved before the slaughtering." The Prophet replied, "There is no harm in it."