1 of 3

R, 58 bytes

b=seq(a<-scan());while(any(b-a))a=matrix(a,,2,F<-F+1)[b];F

Try it online!

Simulates the sorting process. Input is 1-indexed, returns FALSE for 0.