import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N,K = map(int,readline().split()) A = np.array(read().split(),np.int64) A.sort() cand = np.searchsorted(A,(K-A),'right') # 自分のペアにできる人数 mid = np.searchsorted(A,K//2,'right') x = (cand - np.arange(N)[::-1])[mid:] rest = N - 2 * len(x) x = np.concatenate([x,np.arange(1,rest,2)]) MOD = 10 ** 9 + 7 def cumprod(A, MOD = MOD): L = len(A); Lsq = int(L**.5+1) A = np.resize(A, Lsq**2).reshape(Lsq,Lsq) for n in range(1,Lsq): A[:,n] *= A[:,n-1]; A[:,n] %= MOD for n in range(1,Lsq): A[n] *= A[n-1,-1]; A[n] %= MOD return A.ravel()[:L] answer = cumprod(x)[-1] print(answer)