fun main(args: Array<String>) {
    var (N, K) = listOfInt()
    val A = mutableListOf<Int>()
    A.addAll(listOf(0, K))
    listOfInt().forEach { a -> if (a < K) A.add(a) }
    A.sort(); N = A.size
    var l = 0
    var r = N + 1
    while (Math.abs(r - l) > 1 ) {
        val mid = (l + r) / 2
        val dp = BooleanArray(K + 1)
        dp[0] = true
        for (j in 0 until N) {
            if (j == mid) continue
            for (k in K downTo A[j]){
                dp[k] = dp[k] or dp[k - A[j]]
            }
        }
        var need = false
        for (k in K - A[mid] until K) need = need or dp[k]
        if (!need) l = mid else r = mid
    }
    println(l)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun nextLong() = next().toLong()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
fun listOfLong() = listOfString().map(String::toLong)
