One has to believe in the messengers of Allah. That is, one must believe in the Prophets of Allah, both those among them who were messengers and those who were not messengers. The first one of whom is Adam, ^alayhi as-salam, and the last one of them is Muhammad, salla-l-lahu ^alayhi wa sallam. Allah ta^ala said in Surat al-Baqarah verse #285:
﴿لا نفرّق بين أحدٍ من رسُله﴾ سورة البقرة
The verse means: [We make no distinction between any of His messengers] i.e., we believe in them all.