import java.util.*; public class Main { static final int MOD = 1000000007; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } Arrays.sort(arr); long ans = 1; if (k - arr[n - 1] < arr[0]) { System.out.println(0); return; } int right = n - 1; int left = 0; int count = 0; while (right >= n / 2) { while (left + 1 < right && k - arr[right] >= arr[left + 1]) { left++; } if (left + 1 <= count) { System.out.println(0); return; } ans *= left + 1 - count; ans %= MOD; count++; right--; left = Math.min(left, right - 1); } System.out.println(ans); } }