A man asked Sayyiduna Ibn Umar (may Allah be pleased with them both): "Can a man go to his wife before the circuits of Safa and Marwah?" He said: The Messenger of Allah (peace and blessings be upon him) performed tawaf of the House of Allah, then prayed two rak'ahs, then went around Safa and Marwah. Then he recited this verse: "Indeed, in the Messenger of Allah (peace and blessings be upon him) you have the best example." [Surah Al-Ahzab: 21]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9362