This will not affect the validity of your Salah; however, the reward for your Salah will be defective in proportion with the amount of (Part No. 7; Page No. 36) distractive thoughts that obsessed you. Moreover, you have to fight against these distractive thoughts as much as possible so that you can attain the stage of showing submission to Allah (Exalted be He) in Salah. This can take place through reflecting on the verses of the Qur'an the Imam is reciting and thinking about the Majesty and Glory of Allah and that He watches over us. Undoubtedly, even though you do not see Him, He sees you. Moreover, you are to frequently seek refuge with Allah (Exalted be He) from the cursed Satan.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.