Rigid body - conservation laws

A bar of length L and mass M is lying on a frictionless table. A ball with mass m and velocity v hits the bar perpendicularly at a distance d from the bar's center. Assume the collision is fully elastic, and find m such that after the collision only the bar moves.