Mean curvature flow with surgeries of two-convex hypersurfaces