n,*d=$<.read.split.map &:to_i r=[0]*-~n n.times{|i|c=0;o=i;(c+=1;d[o],o=p,d[o]-1)while d[o];r[c]^=c^1} puts r[1,n].any?(&:odd?)?:No:'Yes'