Umar passed by Hassan while he was reciting poetry in the mosque and said, "You recite poetry in the mosque of the Messenger of Allah ﷺ?"Hassan replied, "I used to recite poetry here when one better than you was present," or he said, "I used to recite here when one better than you was present."
حدثنا يعلى حدثنا محمد بن عمرو
مر عمر رضي الله عنه على حسان وهو ينشد الشعر في المسجد فقال في مسجد رسول الله ﷺ تنشد الشعر قال كنت أنشد وفيه من هو خير منك أو كنت أنشد فيه وفيه من هو خير منك
Its isnad is sahih. Muhammad bin Amr is Ibn Alqama. Yahya bin Amr is Ibn Hatib bin Abu Baltaah, and both of them are trustworthy, their hadiths being found in the Sunan collections. The hadith is like the one before it.