#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  bool Neg = false;
  char c;
  for (c = getchar(); c<'0' | c> '9'; c = getchar())
    if (c == '-') Neg = !Neg;
  x = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  if (Neg) x = -x;
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  T p = 1;
  for (T temp = x / 10; temp > 0; temp /= 10) p *= 10;
  for (; p > 0; x %= p, p /= 10) putchar(x / p + '0');
}
namespace bignum {
void fix(string &a, string &b) {
  while (a.length() < b.length()) a = "0" + a;
  while (b.length() < a.length()) b = "0" + b;
}
string operator+(string a, string b) {
  long int sum, carry = 0, i;
  string c = "";
  fix(a, b);
  for (i = a.length() - 1; i >= 0; i--) {
    sum = a[i] - 48 + b[i] - 48 + carry;
    carry = sum / 10;
    c = char(sum % 10 + 48) + c;
  }
  if (carry > 0) c = "1" + c;
  return c;
}
string multi(string a, int b) {
  if (b == 0) return "0";
  if (b == 1) return a;
  string tmp = multi(a, b / 2);
  if (b % 2 == 0)
    return tmp + tmp;
  else
    return a + tmp + tmp;
}
string operator*(string a, string b) {
  string res = "";
  int n = a.length();
  int m = b.length();
  int len = n + m - 1;
  int carry = 0;
  for (int i = len; i >= 0; i--) {
    int tmp = 0;
    for (int j = n - 1; j >= 0; j--)
      if (i - j <= m && i - j >= 1) {
        int a1 = a[j] - 48;
        int b1 = b[i - j - 1] - 48;
        tmp += a1 * b1;
      }
    tmp += carry;
    carry = tmp / 10;
    res = (char)(tmp % 10 + 48) + res;
  }
  while (res.length() > 1 && res[0] == '0') res.erase(0, 1);
  return res;
}
}  // namespace bignum
using namespace bignum;
void file() {}
const int N = 105, K = 1e5 + 5;
const long long mod = 1e9 + 7;
long long f[K], t[K], dp[K];
int n, k, a[N];
void readinp() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
}
void solve() {
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = k; j >= 0; j--) {
      if (f[j]) {
        for (int d = 1; d <= a[i]; d++) {
          if (j + d <= k) f[j + d] += f[j], f[j + d] %= mod;
        }
      }
    }
  }
  cout << f[k];
  cout << '\n';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  file();
  int t = 1;
  while (t--) {
    readinp();
    solve();
  }
}
