import bisect mod = 10 ** 9 + 7 N, K = map(int, input().split()) A = sorted(map(int, input().split())) ans = 1 used = 0 for _ in range(N // 2): R = A.pop() i = bisect.bisect_right(A, K - R) ans *= max(0, i - used) ans %= mod used += 1 print(ans)