First reaction: NaBH$_4$ + I$_2$ $\rightarrow$ A + NaI + H$_2$.
NaBH$_4$ reacts with I$_2$ to form diborane (B$_2$H$_6$).
The balanced reaction is: 2NaBH$_4$ + I$_2$ $\rightarrow$ B$_2$H$_6$ + 2NaI + H$_2$.
So, A = B$_2$H$_6$.
Second reaction: A + LiH $\rightarrow$ B.
B$_2$H$_6$ + 2LiH $\rightarrow$ 2LiBH$_4$.
So, B = LiBH$_4$.
Thus, A = B$_2$H$_6$, B = LiBH$_4$.