Applying the seminal work of Bose in 1924 on what was later known as Bose-Einstein statistics, Einstein predicted in 1925 that at sufficiently low temperatures, a macroscopic fraction of constituents of a gas of bosons will drop down to the lowest available energy state, forming a `giant molecule or a Bose-Einstein condensate (BEC), described by a `macroscopic wavefunction. In this article we show that when the BEC of ultralight bosons extends over cosmological length scales, it can potentially explain the origins of both dark matter and dark energy. We speculate on the nature of these bosons.