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