#include <algorithm>
#include <array>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;


/* range: ± 3.27 * 10^4 */
using i16 = short int;
/* range: 0 to 65535 */
using u16 = short unsigned int;
/* range: ± 2.14 * 10^9 */
using i32 = int;
/* range: 0 to 4.29 * 10^9 */
using u32 = unsigned int;
/* range: ± 9.22 * 10^18 */
using i64 = long long int;
/* range: 0 to 1.84 * 10^19 */
using u64 = long long unsigned int;

constexpr i32 MOD = 1e9 + 7;

constexpr auto getArr() noexcept {
    array<array<i32, 100007>, 101> arr{};
    for (i32 i = 0; i < 101; i++) {
        for (i32 j = 0; j < 100007; j++) {
            arr[i][j] = -1;
        }
    }
    return arr;
}

// vector<vector<i32>> memo;
auto memo = getArr();

i32 dp(const vector<i32>& max_candies, i32 K, size_t idx = 0) {
    if (idx >= max_candies.size()) {
        if (K == 0) {
            return 1;
        }
        return 0;
    }
    if (K == 0) {
        return 1;
    }
    if (memo[idx][K] != -1) {
        return memo[idx][K];
    }

    i32 res = 0;
    for (i32 i = 0; i <= max_candies[idx]; i++) {
        if (i > K) {
            break;
        }
        res += dp(max_candies, K - i, idx + 1);
        res %= MOD;
    }

    memo[idx][K] = res;
    return res;
}

i32 main() {
    i32 n, k;
    cin >> n >> k;

    vector<i32> max_candies(n);
    for (i32 i = 0; i < n; i++) {
        cin >> max_candies[i];
    }

    sort(max_candies.begin(), max_candies.end(), greater<i32>());
    // memo = vector<vector<i32>>(n + 1, vector<i32>(k + 1, -1));
    cout << dp(max_candies, k) << '\n';
    // cout << cnt << '\n';
}