#include <iostream>
#include <iomanip>
#include <algorithm>
#include <array>
#include <cassert>
#include <utility>
#include <vector>

constexpr int mod = 1'000'000'007; // '
// modint構造体
template <int modulus> struct mod_Int{
    int val; // 値本体
    // コンストラクタ
    constexpr mod_Int():val(0){}
    constexpr mod_Int(const int& v):val(v % modulus){ if(val < 0) val += modulus; }
    constexpr mod_Int(int&& v):val(v % modulus){ if(val < 0) val += modulus; }
    constexpr mod_Int(const long long int& v):val(v % modulus){ if(val < 0) val += modulus; }
    constexpr mod_Int(long long int&& v):val(v % modulus){ if(val < 0) val += modulus; }
    constexpr mod_Int(const unsigned int& v):val(v % modulus){}
    constexpr mod_Int(unsigned int&& v):val(v % modulus){}
    constexpr mod_Int(const unsigned long long int& v):val(v % modulus){}
    constexpr mod_Int(unsigned long long int&& v):val(v % modulus){}
    constexpr mod_Int& operator += (const mod_Int<modulus>& other) noexcept {
        val += other.val; if(val >= modulus) val -= modulus;
        return *this;
    }
    constexpr mod_Int& operator -= (const mod_Int<modulus>& other) noexcept {
        val -= other.val; if(val < 0) val += modulus;
        return *this;
    }
    constexpr mod_Int& operator *= (const mod_Int<modulus>& other) noexcept {
        val = static_cast<long long int>(val) * other.val % modulus;
        return *this; 
    }
    constexpr mod_Int& operator /= (const mod_Int<modulus>& other) noexcept {
        val = static_cast<long long int>(val) * other.inverse() % modulus;
        return *this;
    }
    constexpr bool operator == (const mod_Int<modulus>& other) const noexcept {
        return val == other.val;
    }
    constexpr mod_Int operator +(const mod_Int<modulus>& v) const noexcept{
        return mod_Int<modulus>(*this) += v;
    }
    constexpr mod_Int operator -(const mod_Int<modulus>& v)const noexcept{
        return mod_Int<modulus>(*this) -= v;
    }
    constexpr mod_Int operator *(const mod_Int<modulus>& v) const noexcept{
        return mod_Int<modulus>(*this) *= v;
    }
    constexpr mod_Int operator /(const mod_Int<modulus>& v) const noexcept{
        return mod_Int<modulus>(*this) /= v;
    }
    constexpr mod_Int& operator ++(void) noexcept {
        if(++val == modulus) val = 0;
        return *this;
    }
    constexpr mod_Int& operator --(void) noexcept {
        if(val-- == 0) val = modulus - 1;
        return *this;
    }
    constexpr mod_Int operator -()const noexcept{
        return mod_Int<modulus>((val == 0 ? 0 : modulus - val));
    }

    // aの逆元を求める関数
    static constexpr int inverse(int a) noexcept {
        int b = modulus, 
            u = 1, v = 0;
        while (b != 0) {
            const int t = a / b; 
            a -= t * b; std::swap(a, b);
            u -= t * v; std::swap(u, v);
        }
        if(u < 0) u += modulus;
        return u;
    }
    constexpr int inverse(void) const noexcept { return inverse(val); }
    // a^nを返す関数 : nは負の数でも可
    static constexpr int power(long long int a, long long int n){
        long long res = 1, waiting = a;
        if(n < 0) waiting = inverse(), n = -n;
        while(n != 0){ 
            if(n % 2 != 0) res = res * waiting % modulus; 
            waiting = waiting * waiting % modulus; 
            n /= 2;
        }
        return res;
    }
    constexpr mod_Int power(long long int n) const noexcept { mod_Int res; res.val = power(val, n); return res; }
};

using modint = mod_Int<mod>;


template <int modulous>
struct Combination{
    const int sz;
    std::vector<mod_Int<modulous>> Power, Inv_Power, Inv;

    Combination(const int n):sz(n){
        Power.resize(n + 1); Power[0] = 1;
        modint v = 1; for(int i = 1; i <= n; ++i, ++v) Power[i] = Power[i - 1] * v;
        Inv_Power.resize(n + 1); Inv_Power[n] = Power[n].inverse();
        v = n; for(int i = n; i > 0; --i, --v) Inv_Power[i - 1] = Inv_Power[i] * v;
        Inv.resize(n + 1);
        Inv[0] = 0; for(int i = 1; i <= n; ++i) Inv[i] = Inv_Power[i] * Power[i - 1];
    }

    modint combination(const int n, const int k) const {
        if(k < 0 or n < k) return modint();
        return Power[n] * Inv_Power[k] * Inv_Power[n - k];
    }
};

int main(void){
    std::cin.tie(nullptr); std::cin.sync_with_stdio(false); 
    std::cout << std::fixed << std::setprecision(16);

    int n, K; std::cin >> n >> K;
    const int M = n + K + 1;
    Combination<mod> U(M);
    
    std::vector<modint> F(K + 1); F[0].val = 1;
    for(int i = 0; i < n; ++i){
        int a; std::cin >> a; ++a; for(int d = K - a; d >= 0; --d) F[d + a] -= F[d];
    }
    modint res;
    for(int i = 0; i <= K; ++i) res += U.combination(n + i - 1, n - 1) * F[K - i];
    std::cout << res.val << '\n';
    return 0;
}

Measured memory_bytes: 4708