Sahih al-Bukhari, Volume 2, Book 26, Hadith 781 (USC-MSA)

Narrated 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."

حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا عَبْدُ الأَعْلَى، حَدَّثَنَا خَالِدٌ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ ـ رضى الله عنهما ـ قَالَ سُئِلَ النَّبِيُّ صلى الله عليه وسلم فَقَالَ رَمَيْتُ بَعْدَ مَا أَمْسَيْتُ‏.‏ فَقَالَ ‏"‏ لاَ حَرَجَ ‏"‏‏.‏ قَالَ حَلَقْتُ قَبْلَ أَنْ أَنْحَرَ‏.‏ قَالَ ‏"‏ لاَ حَرَجَ ‏"‏‏.‏

sunnah.com