#include <bits/stdc++.h>
using namespace std;
int arr[101];
int n;
int dp[101][100001];
long solve(int index, int k) {
  if (index == n and k == 0) return 1;
  if (index == n and k != 0) return 0;
  if (k < 0) {
    return dp[index][0] = 0;
  }
  if (dp[index][k] != -1) return dp[index][k];
  long ans = 0;
  for (int i = 0; i <= arr[index] and i <= k; i++) {
    ans = (ans + solve(index + 1, k - i)) % 1000000009;
  }
  return dp[index][k] = ans;
}
int main() {
  int k;
  cin >> n >> k;
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) cin >> arr[i];
  long ans = solve(0, k);
  cout << ans;
  return 0;
}
