N,K=map(int,input().split()) A=list(map(int,input().split())) from bisect import bisect_right as br A.sort() rem=[0]*(N+1) for i in range(N-1,-1,-1 ): r=K-A[i] idx=min(br(A,r),i) rem[i]=idx ans=1 mod=10**9+7 n=0 for i in range(N-1,-1,-1): ans=ans*(rem[i]-n)%mod n+=1 print(ans%mod)