#include <bits/stdc++.h>
using namespace std;
int n, t, i, j, x, k;
map<int, long long> m, mv;
long long ans;
int main() {
  cin >> n >> k;
  m[0] = 1;
  for (i = 1; i <= n; i++) {
    mv = m;
    m.clear();
    cin >> x;
    for (j = 0; j <= x; j++) {
      for (auto it : mv) {
        if (j + it.first > k) break;
        m[j + it.first] += it.second;
        m[j + it.first] %= 1000000007;
      }
    }
  }
  cout << m[k];
  return 0;
}
