#include <bits/stdc++.h>
using namespace std;
const int N = 100, N2 = 1e5, M = 1e9 + 7;
long long dp[N + 1][N2 + 1];
long long a[N];
long long n, x;
int main() {
  cin >> n >> x;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i <= n; ++i) dp[i][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int s = 1; s <= x; ++s) {
      dp[i][s] = dp[i - 1][s];
      cout << s << "\n";
      for (int f = 1; f <= min(x, a[i - 1]) && s - f >= 0; ++f) {
        dp[i][s] = (dp[i][s] + dp[i - 1][s - f]) % M;
      }
    }
  }
  cout << dp[n][x] << "\n";
}
