KAM for the nonlinear beam equation