n,k,*d=$<.read.split.map &:to_i c=0 n.times{|i|x=d[i]&&c-=1;(c+=1;d[i],i=p,x-1)while x} puts c>k||c+k&1>0?:NO:'YES'