3 4 1 3 6 2 4 6 2 1 3 4 8 1 6 7
invalid valid valid hint: For test case #1£ºThe path $1\rightarrow 3$ skipped the middle point $2$, so it's invalid. For test case #2£ºThe path $1\rightarrow 3$ doesn't skipped the middle point $2$, because the point 2 has been through, so it's valid. For test case #2£ºThe path $8\rightarrow 1 \rightarrow 6 \rightarrow 7$ doesn't have any the middle point $2$, so it's valid.