Consider N-1 slots containing B ones. When the first slot
is 0 then B one bits are distributed into into N-2 slots,
and when the first slot is 1, then B-1 one bits are distributed
into N-2 slots. The sum of the number of ways that each case can
happen counts the number of ways that B one bits may be distributed
into N-1 slots, or
Similarly C(N-2,B-1) + C(N-2,B-2)
= C(N-2,B-1). Finally, consider N slots, and
look at the possible ways to have the first two slots 00, 01, 10, 11 respectively.
Their sum counts B one bits into N slots.