import java.io.*;
import java.util.*;

public class Ludo_Sort {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();

		ArrayList<Integer> array = new ArrayList<Integer>(N);
		for (int i = 0; i < N; i++) {
			int number = sc.nextInt();
			array.add(number);
		}

		Collections.sort(array);

		// crude O(N^2) solutions should still pass...

		int ret = 1;

		for (int i = 1; i < N; i++) {
			if (array.get(i - 1) + array.get(i) <= X) {
				// A + B < X
				if (i + 1 > ret)
					ret = i + 1;
				// S = { 0, 1, \dots, i, j }
			}
		}

		System.out.println(ret);
	}
}

