N, K = gets.split.map(&:to_i) as = gets.split.map(&:to_i).sort MOD = 10**9+7 ans = 1 pt = 0 pool = 0 (N-1).downto(0) do |i| while pt < i && as[pt] + as[i] <= K pt += 1 pool += 1 end if pt == i pool += 1 break end if pool == 0 puts 0 exit end ans = ans * pool % MOD pool -= 1 end while pool > 0 ans = ans * (pool - 1) % MOD pool -= 2 end puts ans