Usul al-Kafi
Book 4:
The Book of Divine Proof

Chapter 6
Supplement to the previous chapter

307. 1. Imam Jafar as-Sadiq (p): Even if only two men remain on the earth, one of them will be a Hujjat (an Imam).