All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Any person who abandons the prayer while denying its legitimacy goes out of the fold of Islam according to the consensus of the scholars . Indeed, there is absolute evidence that the acts of worship of a non-Muslim are not accepted. Allaah Says (what means): {And what prevents their expenditures from being accepted from them but that they have disbelieved in Allaah and in His Messenger.}[Quran 9:54]. Allaah also Says (what means): {The example of those who disbelieve in their Lord is [that] their deeds are like ashes which the wind blows forcefully on a stormy day; they are unable [to keep] from what they earned a [single] thing. That is what extreme error is.}[Quran 14:18]. There are other verses in this regard.
As regards a person who abandons the prayer out of laziness, then we do not know absolute evidence which states that his fasting is not accepted; this depends on the ruling of abandoning the prayer. The scholars who are of the view that a person who abandons the prayer out of laziness goes out of the fold of Islam, they have absolute evidence from the Book of Allaah and the Sunnah of the Prophet that the acts of worship of a non-Muslim are not accepted. On the other hand, the scholars who are of the opinion that a person does not go out of the fold of Islam just for abandoning the prayer(out of laziness), did not state that his fasting is not valid.
Allaah Knows best.