Legal. Here’s the language of the rule:
“2. The ball remains live if, at the snap, a place-kick holder with his knee(s) on the ground and with a teammate in kicking position rises and catches or recovers an errant snap and immediately returns his knee(s) to the ground and places the ball for a kick or again rises to advance, hand, kick or pass.
NOTE: The ball becomes dead if the place-kick holder muffs the snap or fumbles and recovers after his knees have been off the ground, and he then touches the ground with other than hand or foot while in possession of the ball.”