Click on figure to enlarge
velocity of mass m2 along the incline will not change let the velocity of mass m2 perpendicular to incline after collision be V
hence net velocity V2 after collision of mass M2 will be root(v^2 + (u2sin

)^2)
let velocity of mass M1 after collision be V1 towards left which is component of Va
so along common normal direction of collision i.e perp. to incline
we have
V + Va = e (U2cos

)--------------------------1
conserving momentum along this direction
M1Va - M2V = M2U2cos

------------------2
solve 1 &2 to get Va and V
hence V1 is Vasin

& V2 is root(v^2 + (u2sin

)^2)