import java.util.*
import kotlin.collections.ArrayList

fun main() {
    val (n,k) = readLine()!!.split(" ").map { it.toInt() }
    val arr = readLine()!!.split(" ").map { it.toInt() }.sorted()

    val fdp = Array(n+1){BooleanArray(k)}
    val bdp = Array(n+1){BooleanArray(k)}


    for(i in 1..n) {
        fdp[i-1][0] = true
        val v = arr[i - 1]
        for(j in 1 until k) {
            if(j - v < 0) continue
            fdp[i][j] =  fdp[i-1][j] or fdp[i-1][j-v]
        }
    }

    for(i in 1..n) {
        bdp[i-1][0] = true
        val v = arr[n - i]
        for(j in 1 until k) {
            if(j - v < 0) continue
            bdp[i][j] =  bdp[i-1][j] or bdp[i-1][j-v]
        }
    }

    var ans = 0
    for(i in 0 until n) {
        if(arr[i] >= k)
            continue

        val f = fdp[i]
        val b = bdp[n - 1 - i]

        var has = false

        for(j in 0 until k) {
            if(!f[j]) continue
            if(j >= k - arr[i] && j <= k - 1) {
                has = true
                break
            }
        }

        if(has) {
            continue
        }

        for(j in 0 until k) {
            if(!b[j]) continue
            if(j >= k - arr[i] && j <= k - 1) {
                has = true
                break
            }
        }

        if(has) {
            continue
        }

        for(j in 0 .. k - arr[i]) {
            if(f[j] && b[k - arr[i] - j]) {
                has = true
                break 
            }
        }

        // f[j] 에서 k - arr[i] 보다 작은 애들.
        // b[j] 에서 k - arr[i] 보다 작은 애들.
//        val l1 = ArrayList<Int>()
//
//        for(j in 1 until k) {
//            if(!f[j]) continue
//            if( j >= k - arr[i])
//                break
//            l1.add(j)
//        }
//
//        val r1 = TreeSet<Int>()
//        for(j in 1 until k) {
//            if(!b[j]) continue
//            if( j >= k - arr[i])
//                break
//            r1.add(j)
//        }
//
//        val req = k - arr[i] - 1
//        for(d in l1) {
//            val v = r1.higher(req - d)?:continue
//            if(v + d >= k) {
//                break
//            }
//            has = true
//            break
//        }

        if(!has) {
            ++ans
        }
    }
    print(ans)


}