Since it is not stated otherwise, assume the wire is massless. Draw a free body diagram for each mass and apply Newtons 2nd law to each of them. The tension in the wire will be uniform (massless wire) and the masses will have common magnitudes of displacement, velocity, and acceleration.