n,m,*c=$<.read.split.map &:to_i;p n.times.find{|i|0>m-=c.sort[i]}||n