N, T = gets.split.map(&:to_i)
stage = Array.new
N.times do
  stage.push(gets.to_i)
end
stage.sort!
answer = 1
for i in 1...N do
  n = stage[0, i].index{|e| e >= stage[i] - T}
  next if n == nil
  answer *= i - n + 1
  answer %= 1000000007
end
p answer