You need both.
The permits are for JMT south of devils postpile, and jmt north of devils postpile. Further, by exiting wilderness to flip flop, any permit you are hiking under is immediately invalid, except for under 24 hrs to resupply, and you must reenter same trailhead. Ie you cant go to another trailhead.