The order of leaving tendency is
$C l^{-}>R C O O^{-}>R O^{-}>N H_{2}^{-}$ and therefore, the order of reactivity of acyl compound is as
$\mathop {ACOCl}\limits_{(Acyl\,chloride)} > \mathop {\begin{array}{*{20}{c}}
{^{RCO}\backslash } \\
{_{RCO}/}
\end{array}O}\limits_{(Acid\,anhydride)} > \mathop {RCOOR}\limits_{(Ester)} > \mathop {RCON{H_2}}\limits_{(Amide)} $
$[Figure]$ $\longrightarrow \,\,A\,\xrightarrow{{{C_6}{H_5}N{H_2}}}B$