[Machine] I pray at home and then I go to the mosque and find the Imam praying. Should I pray with him? Sa'id replied, "Yes." The man asked, "Which one should I consider my prayer?" Sa'id said, "What you do is up to you. It is for Allah to decide which of the two is accepted. The first statement is the most authentic in the narration of Abu Dharr, Yazid ibn al-Aswad, and it is also mentioned by Uthman ibn Ubaydullah ibn Abu Rafi who said, "I asked Ibn Umar about repeating the prayer. He said the first obligatory prayer, as if he had been informed of that without being informed about it, he did not cut anything in it. Allah knows best."
إِنِّي أُصَلِّي فِي بَيْتِي ثُمَّ آتِي الْمَسْجِدَ فَأَجِدُ الْإِمَامَ يُصَلِّي أَفَأُصَلِّي مَعَهُ؟ فَقَالَ سَعِيدٌ نَعَمْ قَالَ الرَّجُلُ فَأَيَّتُهُمَا أَجْعَلُ صَلَاتِي؟ فَقَالَ سَعِيدٌ وَأَنْتَ تَجْعَلُهَا؟ إِنَّمَا ذَلِكَ إِلَى اللهِ يَجْعَلُ أَيَّتَهُمَا شَاءَ وَالْقَوْلُ الْأَوَّلُ أَصَحُّ لِحَدِيثِ أَبِي ذَرٍّ وَيَزِيدَ بْنِ الْأَسْوَدِ وَيُذْكَرُ عَنْ عُثْمَانَ بْنِ عُبَيْدِ اللهِ بْنِ أَبِي رَافِعٍ أَنَّهُ قَالَ سَأَلْتُ ابْنَ عُمَرَ عَنْ إِعَادَةِ الصَّلَاةِ فَقَالَ الْمَكْتُوبَةُ الْأُولَى فَكَأَنَّهُ بَلَغَهُ فِي ذَلِكَ مَا لَمْ يَبْلُغْهُ حِينَ لَمْ يَقْطَعْ فِيهَا بِشَيْءٍ وَاللهُ تَعَالَى أَعْلَمُ