Try,
In B2, array (CSE) formula copied down :
=IF(OR((A2-N(A1))>1,ISTEXT(A1)),INDEX(FREQUENCY(IF($A$3:$A$12-$A$2:$A$11=1,ROW($A$2:$A$11)),IF($A$3:$A$12-$A$2:$A$11<>1,ROW($A$2:$A$11)))+1,COUNT(B$1:B1)+1),"")
Confirmed by pressing with "Ctrl"+"Shift"+"Enter" in entry
View attachment 76892