Dear Student
According to Newton's third law of motion, if a body A exert force F on another body B then an equal and opposite force F' is exerted by body B on body A.
F = - F'
m1a1 =- m2a2
a1 = - m2 a2/m1
So the magnitude of the acceleration of A IS m2 a2/m1
Regards