Let $(G_1,+_1)$ and $(G_2,+_2)$ be groups. Define the set $M$ to be all functions from $G_1$ to $G_2$. Equip $M$ with the binary operation $\star$ where $f_1\star f_2$ is given by $g\mapsto f_1(g)+_2 f_2(g)$. It can be shown $M$ is a group. What additional condition is necessary for $M$ to be abelian?