Ubayy bin Kaab reported,

Two men traced their lineages in the time of the Messenger of Allah ﷺ. One of them said, "I am so-and-so, son of so-and-so. Who are you, may you have no mother?"The Messenger of Allah ﷺ said, "Two men traced their lineages in the time of Musa عليه السلام. One of them said, 'I am so-and-so, son of so-and-so,' counting back nine ancestors, 'so who are you, may you have no mother?'The other replied, 'I am so-and-so, son of so-and-so, son of Islam.'Then Allah revealed to Musa عليه السلام, 'As for these two who have traced their lineages, as for you who claimed descent from nine ancestors who are in the Fire, you are the tenth of them. And as for you who traced your lineage to two who are in Paradise, you are the third of them in Paradise.'"

Ahmad 21178

Sahih

حدثنا عبد الله حدثني أبو بكر بن أبي شيبة حدثنا ابن نمير حدثنا يزيد بن أبي زياد بن أبي الجعد عن عبد الملك بن عمير عن عبد الرحمن بن أبي ليلى

عن أبي بن كعب قال

انتسب رجلان على عهد رسول الله ﷺ فقال أحدهما أنا فلان بن فلان فمن أنت لا أم لك فقال رسول الله ﷺ انتسب رجلان على عهد موسى عليه السلام فقال أحدهما أنا فلان بن فلان حتى عد تسعة فمن أنت لا أم لك قال أنا فلان بن فلان ابن الإسلام قال فأوحى الله إلى موسى عليه السلام أن هذين المنتسبين أما أنت أيها المنتمي أو المنتسب إلى تسعة في النار فأنت عاشرهم وأما أنت يا هذا المنتسب إلى اثنين في الجنة فأنت ثالثهما في الجنة

أحمد 21178صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdul-Rahman bin Abu Layla from Ubayy bin Kaab
Numbering
Darussalam 21178
Ahmad 21178