Tawhid and prayer form the foundation of Islam and the acceptance of works, Allah has said (in a close approximation of His words):
“What prevents their gifts from being accepted is their lack of belief in Allah and His Messenger.”
According to Abi Hourayra, the Prophet ﷺ, said:
“The first thing the servant will be judged on the day of resurrection is prayer, if it is correct, then he will prosper and succeed. If it is incorrect, he will fail and lose.” [Reported by Thirmidhi, who declared it good]
The preceding hadith from Abi Hourayra, may Allah be pleased with him, indicates that the validity of prayer implies the acceptance of all works, including the other pillars of Islam.
Source: Twitter of Sheikh Hamad Al ‘Othman, may Allah preserve him (@Hamad_Al_Othman)