N, K = gets.split.map(&:to_i) A = gets.split.map(&:to_i).sort MOD = 10 ** 9 + 7 upper = A.select { |a| a > K / 2 }.reverse lower = A.select { |a| a <= K / 2 } ans = 1 ls = lower.size upper.each_with_index do |a, i| lim = K - a idx = lower.bsearch_index { |b| lim < b } || lower.size ans *= (idx - i) ans = 0 if ans < 0 ans %= MOD ls -= 1 end while ls > 0 ans *= (ls - 1) ans %= MOD ls -= 2 end puts ans