#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100100;
const long long mod = 1000000009;
long long dp[110][MAXN];
long long pre[110][MAXN];
long long arr[110];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  dp[0][0] = 1;
  for (long long i = 0; i < 100010; i++) {
    pre[0][i] = 1;
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 100010; j++) {
      if (j <= arr[i]) {
        dp[i][j] = pre[i - 1][j];
      } else {
        dp[i][j] = (pre[i - 1][j] - pre[i - 1][j - arr[i] - 1] + mod) % mod;
      }
    }
    pre[i][0] = dp[i][0];
    for (long long j = 1; j < 100010; j++) {
      pre[i][j] = (pre[i][j - 1] + dp[i][j]) % mod;
    }
  }
  cout << dp[n][k] << endl;
}
