import scala.io.StdIn._
object Main extends App {
  val mod = 1000000007L
  val Array(n, w) = readLine.trim.split(' ').map(_.toInt)
  val friends = Array.tabulate(n){_ ⇒ readInt()}.sorted
  val sumWeights = 0 +: friends
  for (i ← sumWeights.indices.tail) sumWeights(i) += sumWeights(i - 1)
  var result = if (friends.sum <= w) 1L else 0L
  val memo = Array.fill(w + 1){0L}//memo(w) => (i, n]の友達の組み合わせで重さがwになるもの
  memo(0) = 1
  for (i ← (0 until n).reverse) {
    for (d ← ((w - friends(i) + 1) to w).map{_ - sumWeights(i)} if memo.indices.contains(d)) {
      result += memo(d)
    }
    result %= mod
    for (d ← (0 to w - friends(i)).reverse) {
      memo(d + friends(i)) += memo(d)
      memo(d + friends(i)) %= mod
    }
  }
  println(result)
}
