By rule the kick is only dead if it touches the ground in the EZ "untouched" by B.
Per Rule 4-1-3-c, the ball becomes dead: When a touchdown, touchback, safety, field goal or successful try occurs; or when an unsuccessful field-goal attempt that has crossed the neutral zone and is then untouched by Team B lands in Team B’s end zone or out of bounds (A.R. 6-3-9-I).
So if it's muffed by B beyond the NZ prior to touching ground and then is recovered by A in the EZ then it's 2 points.
Also, AR 6-3-9-III is basically the same play: A Team B player touches a scrimmage kick in flight in Team B’s end zone, and Team A downs the ball in the end zone. RULING: Team A touchdown (Rules 6-3-3 and 8-2-1-e).