Yes. The foul is during a scrimmage kick, the kick crosses the neutral zone, Team B will next put the ball in play, and the kick is not a try, successful field goal, or in extra periods.
The PSK spot is the end of the kick which is the B-20 and the spot of the foul is the B-22. Since the spot of the foul is beyond the basic spot (PSK spot), the penalty will be enforced from the B-20 and it will be B's ball, 1st and 10 from the B-10.
If B had touched the punt prior A24's recovery, it would not be PSK because A would then be in legal possession and B would not be next to put the ball in play.