#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned long long a, b, c, sum, i, j;
  vector<unsigned long long> candy;
  cin >> a >> b;
  unsigned long long chart[a + 1][b + 1];
  for (int i = 0; i < a; i++) {
    cin >> c;
    candy.push_back(c);
  }
  sort(candy.begin(), candy.end());
  sum = 0;
  for (i = 0; i < a + 1; i++) {
    if (i != 0)
      for (j = 0; j < b + 1; j++) {
        if (j == 0) {
          chart[i][j] = 1;
        } else if (i == 0) {
          chart[i][j] = 0;
        } else if (j <= candy[i - 1]) {
          chart[i][j] = (chart[i - 1][j] + chart[i][j - 1]) % 1000000007;
        } else {
          chart[i][j] =
              (chart[i][j - 1] - chart[i][j - candy[i - 1] - 1] + 1000000007) %
              1000000007;
        }
      }
  }
  cout << chart[a][b] % 1000000007 << endl;
}
