n,k=gets.split.map &:to_i a=gets.split.map(&:to_i).sort q=1 m=10**9+7 b=[] a.each_slice(2){|x,y| q=0 if x+y>k i=b.bsearch_index{|z|x+z>k}||b.size j=b.bsearch_index{|z|y+z>k}||b.size q+=i*j-[i,j].min b<