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